/* Sistema de Arquivos para Produtos - PlayLúdico */

/* Modal de Arquivos */
.playludico-files-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.playludico-files-modal .modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.playludico-files-modal .modal-header {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.playludico-files-modal .modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.playludico-files-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.playludico-files-modal .close-modal:hover,
.playludico-files-modal .close-modal:focus {
    opacity: 0.7;
}

.playludico-files-modal .modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.playludico-files-modal .files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playludico-files-modal .file-item-modal {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.playludico-files-modal .file-item-modal:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.playludico-files-modal .file-download-link {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.3s ease;
}

.playludico-files-modal .file-download-link:hover {
    background: #e9ecef;
    text-decoration: none;
    color: #333;
}

.playludico-files-modal .file-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #007cba;
    font-size: 1.1em;
}

.playludico-files-modal .file-description {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    line-height: 1.4;
}

.playludico-files-modal .file-meta {
    font-size: 0.8em;
    color: #999;
    font-style: italic;
}

.playludico-files-modal .no-files-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.playludico-files-modal .no-files-message .icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

/* Botão de Arquivos na Grid de Jogos */
.btn-files {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-files:hover {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    color: white;
}

/* Badge indicador de arquivos disponíveis */
.files-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FF9800;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    z-index: 5;
}

/* Melhorias adicionais para integração */
.game-card .game-image {
    position: relative;
}

.game-card .files-badge {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 5 !important;
}

/* Ajustes para o layout dos botões quando há 2 botões */
.game-actions {
    display: flex;
    gap: 8px;
}

.game-actions .btn-play,
.game-actions .btn-files {
    flex: 1;
    font-size: 0.9rem;
    padding: 12px 10px;
}

@media (max-width: 480px) {
    .game-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .game-actions .btn-play,
    .game-actions .btn-files {
        flex: none;
        font-size: 1em;
        padding: 12px;
    }
}

/* Loading state para o modal */
.modal-loading {
    text-align: center;
    padding: 40px 20px;
}

.modal-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF9800;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .playludico-files-modal .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .playludico-files-modal .modal-body {
        max-height: 300px;
    }
    
    .playludico-files-modal .file-download-link {
        padding: 12px;
    }
    
    .playludico-files-modal .file-name {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .playludico-files-modal .modal-content {
        width: 98%;
        margin: 5% auto;
    }
    
    .playludico-files-modal .modal-header {
        padding: 15px;
    }
    
    .playludico-files-modal .modal-header h3 {
        font-size: 1.2em;
    }
}
