/* Styles pour la page d'espace avec thèmes et sous-thèmes */
:root {
    --theme-transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --theme-shadow-normal: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --theme-shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    --theme-shadow-active: 0 8px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    --theme-border-radius: 16px;
}

.space-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
    font-family: 'Roboto', sans-serif;
    perspective: 1200px; /* Ajouter perspective pour les effets 3D */
}

/* Header de l'espace */
.space-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.space-header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    color: #333;
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display', serif;
}

.space-header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.btn-link {
    display: inline-block;
    color: #4285F4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.btn-link:hover {
    color: #2c5fb8;
    text-decoration: underline;
}

/* Conteneur des thèmes */
.themes-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin: 2.5rem auto;
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
    max-width: 850px;
    padding: 1rem;
}

.theme-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    background: transparent;
    border: none;
    padding: 0.5rem;
    width: auto;
    min-width: 80px;
}

/* Effet d'apparition progressive */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Délai d'animation séquentiel pour les cartes */
.theme-card:nth-child(1) { animation-delay: 0.1s; }
.theme-card:nth-child(2) { animation-delay: 0.2s; }
.theme-card:nth-child(3) { animation-delay: 0.3s; }
.theme-card:nth-child(4) { animation-delay: 0.4s; }

.theme-card:hover {
    transform: translateY(-7px);
}

.theme-card:hover .theme-icon {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 8px 20px rgba(var(--theme-color-rgb), 0.4);
}

.theme-card:hover .theme-icon::before {
    opacity: 1;
    filter: blur(12px);
}

/* Effet de lumière au survol */
.theme-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(var(--theme-color-rgb, 66, 133, 244), 0.15) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.theme-card.active .theme-icon::before {
    opacity: 1;
    filter: blur(15px);
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    background: radial-gradient(
        circle, 
        rgba(var(--theme-color-rgb), 0.8) 0%,
        rgba(var(--theme-color-rgb), 0.5) 30%,
        rgba(var(--theme-color-rgb), 0.2) 60%,
        rgba(var(--theme-color-rgb), 0) 75%
    );
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}

.theme-card.active .theme-icon {
    transform: scale(1.2) translateY(-8px);
    box-shadow: 0 10px 25px rgba(var(--theme-color-rgb), 0.5);
    animation: float 3s infinite ease-in-out;
}

@keyframes float {
    0% { transform: scale(1.2) translateY(-8px); }
    50% { transform: scale(1.2) translateY(-12px); }
    100% { transform: scale(1.2) translateY(-8px); }
}

.theme-icon {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    margin: 0.3rem auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.2, 0.85, 0.4, 1.2);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
    /* Assurez-vous que la variable CSS est bien transmise */
    --theme-color-rgb-local: var(--theme-color-rgb, 66, 133, 244);
}

/* Aura colorée autour de l'icône */
.theme-icon::before {
    content: '';
    position: absolute;
    top: -18px;
    left: -18px;
    right: -18px;
    bottom: -18px;
    border-radius: 50%;
    background: radial-gradient(
        circle, 
        rgba(var(--theme-color-rgb), 0.7) 0%,
        rgba(var(--theme-color-rgb), 0.4) 35%,
        rgba(var(--theme-color-rgb), 0.2) 60%,
        rgba(var(--theme-color-rgb), 0) 75%
    );
    z-index: -1;
    opacity: 0.8;
    filter: blur(10px);
    transition: all 0.4s ease;
}

.theme-icon i {
    font-size: 24px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.theme-card:hover .theme-icon {
    transform: translateZ(25px) scale(1.12);
    box-shadow: 0 8px 25px rgba(var(--theme-color-rgb, 66, 133, 244), 0.5);
}

.theme-card:hover .theme-icon i {
    transform: scale(1.1);
}

/* Animation de l'icône lorsque actif */
.theme-card.active .theme-icon {
    transform: translateZ(30px) scale(1.15);
    animation: floating 3s ease-in-out infinite;
    box-shadow: 0 10px 25px rgba(var(--theme-color-rgb, 66, 133, 244), 0.6),
                inset 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Animation flottante pour l'icône active */
@keyframes floating {
    0% { transform: translateZ(30px) scale(1.15); }
    50% { transform: translateZ(35px) scale(1.17); }
    100% { transform: translateZ(30px) scale(1.15); }
}

/* Effet d'onde au clic sur l'icône */
.theme-card:active .theme-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    animation: ripple 0.8s cubic-bezier(0, 0.5, 0.5, 1) forwards;
    z-index: 1;
    transform: scale(0.5);
    opacity: 0.8;
}

@keyframes ripple {
    to {
        transform: scale(1.5);
        opacity: 0;
    }
}

.theme-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #444;
    transition: all 0.3s ease;
    margin-top: 0.2rem;
    letter-spacing: 0.3px;
    text-align: center;
}

.theme-card:hover .theme-title {
    color: var(--theme-color, #4285F4);
    font-weight: 600;
}

.theme-card.active .theme-title {
    color: var(--theme-color, #4285F4);
    font-weight: 600;
}

/* Aucun indicateur visuel supplémentaire n'est nécessaire */

.theme-card:hover .theme-title {
    font-weight: 600;
    transform: translateZ(10px);
    color: var(--theme-color, #4285F4);
}

.theme-card.active .theme-title {
    font-weight: 700;
    color: var(--theme-color, #4285F4);
    transform: translateZ(12px);
    text-shadow: 0 1px 2px rgba(var(--theme-color-rgb, 66, 133, 244), 0.2);
}

/* Conteneur des sous-thèmes */
.subtheme-container {
    margin-bottom: 1.5rem;
}

.subtheme-container h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: #333;
    font-family: 'Playfair Display', serif;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

.subtheme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.subtheme-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subtheme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.folder-icon {
    flex-shrink: 0;
    width: 40px;
    height: 32px;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bootstrap Icons est maintenant utilisé à la place des SVG */
.bi {
    font-size: 1.5rem;
}

.subtheme-content {
    flex-grow: 1;
}

.subtheme-content h3 {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.subtheme-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.subtheme-card:hover .card-overlay {
    opacity: 1;
}

.access-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: #4285F4;
    color: white;
    border-radius: 20px;
    font-weight: 500;
    transform: translateY(10px);
    transition: all 0.3s;
    opacity: 0;
}

.subtheme-card:hover .access-btn {
    transform: translateY(0);
    opacity: 1;
}

/* Conteneur des documents */
.document-container {
    margin-top: 1rem;
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eaecef;
}

.add-document-btn {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-document-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.document-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 400;
    color: #333;
    font-family: 'Playfair Display', serif;
}

.back-button {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #4285F4;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #f0f7ff;
}

/* Styles supplémentaires pour Bootstrap Icons */
.theme-icon .bi {
    font-size: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #4285F4;
    color: white;
}

.btn-primary:hover {
    background-color: #2c5fb8;
}

.upload-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('../images/icons/upload.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 8px;
}

.empty-documents {
    background-color: #f8f9fa;
    padding: 0.75rem 0;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

/* Styles pour le nouveau système de types de documents */
.document-types-container {
    margin-top: 1.5rem;
}

.document-type-group {
    margin-bottom: 2rem;
}

.document-type-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eaecef;
    display: flex;
    align-items: center;
}

.document-type-title i {
    margin-right: 0.5rem;
    color: #4285F4;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.document-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-info {
    flex-grow: 1;
    overflow: hidden;
}

.document-info h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-date, .document-size {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.document-actions {
    margin-left: 1rem;
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.document-actions button {
    position: relative;
    transition: all 0.2s ease;
}

.document-actions button:hover {
    transform: translateY(-2px);
}

.action-tooltip {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.document-actions button:hover .action-tooltip {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: #f5f5f5;
}

/* Icônes remplacées par Bootstrap Icons */
.document-icon .bi {
    font-size: 2rem;
}

.document-actions .bi {
    font-size: 1.2rem;
}

/* Utilisation des icônes Bootstrap au lieu des SVG personnalisés */
.folder-icon .bi {
    font-size: 1.8rem;
    color: #4285F4;
}

.back-button .bi {
    font-size: 1.2rem;
    margin-right: 0.3rem;
}

.error-container {
    max-width: 500px;
    margin: 3rem auto;
    text-align: center;
    padding: 2rem;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.error-container h3 {
    color: #EA4335;
    margin-top: 0;
}

/* Design responsive */
@media (max-width: 768px) {
    .theme-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .theme-container::-webkit-scrollbar {
        display: none;
    }
    
    .theme-card {
        flex: 0 0 auto;
        width: 150px;
    }
    
    .document-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .document-header h2 {
        margin: 1rem 0;
    }
    
    .document-grid {
        grid-template-columns: 1fr;
    }
    
    .document-type-title {
        font-size: 1.1rem;
    }
    
    .subtheme-grid {
        grid-template-columns: 1fr;
    }
    
    .space-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .space-container {
        padding: 1rem;
    }
    
    .theme-icon {
        width: 50px;
        height: 50px;
    }
    
    .theme-title {
        font-size: 0.9rem;
    }
    
    .subtheme-container h2 {
        font-size: 1.5rem;
    }
}
