/**
 * Styles responsive pour TETProgram Fusion
 * Adaptation sur tous les appareils
 */

/* Mobile First */
.tetfusion-plugin {
    --container-padding: 10px;
}

/* Smartphones (portrait) */
@media (max-width: 575.98px) {
    .tetfusion-plugin {
        --container-padding: 8px;
    }

    .tetfusion-container {
        padding: 0 var(--container-padding);
    }

    /* Navigation mobile */
    .tetfusion-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 -2px 10px var(--shadow-color);
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        z-index: 1000;
    }

    .tetfusion-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.7rem;
        color: var(--gray-color);
        padding: 4px 8px;
        border: none;
        background: none;
        cursor: pointer;
    }

    .tetfusion-nav-item.active {
        color: var(--primary-color);
    }

    .tetfusion-nav-item .icon {
        font-size: 1.3rem;
        margin-bottom: 2px;
    }

    /* Cards en colonne */
    .tetfusion-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Profile */
    .tetfusion-profile-cover {
        height: 150px;
    }

    .tetfusion-profile-header {
        margin-top: -40px;
        padding: 0 10px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tetfusion-profile-avatar {
        width: 70px;
        height: 70px;
    }

    .tetfusion-profile-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
    }

    /* Activity */
    .tetfusion-activity {
        padding: 12px;
        margin-bottom: 12px;
    }

    .tetfusion-activity-header .avatar {
        width: 35px;
        height: 35px;
    }

    .tetfusion-activity-content {
        font-size: 0.95rem;
    }

    .tetfusion-activity-actions {
        flex-wrap: wrap;
    }

    .tetfusion-activity-actions button {
        padding: 6px 12px;
        font-size: 0.8rem;
        flex: 1;
        min-width: 50px;
    }

    .tetfusion-activity-stats {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    /* Commentaires */
    .tetfusion-comment .avatar {
        width: 28px;
        height: 28px;
    }

    .tetfusion-comment-form textarea {
        min-height: 40px;
        font-size: 0.9rem;
    }

    /* Chat */
    .tetfusion-chat-window {
        width: 100%;
        height: 100%;
        bottom: 60px;
        right: 0;
        border-radius: 0;
        max-height: none;
    }

    .tetfusion-chat-toggle {
        bottom: 75px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Notifications */
    .tetfusion-notification {
        padding: 10px;
    }

    .tetfusion-notification .avatar {
        width: 32px;
        height: 32px;
    }

    /* Forms */
    .tetfusion-form-control {
        font-size: 0.95rem;
        padding: 10px;
    }

    .tetfusion-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        width: 100%;
    }

    /* Modal */
    .tetfusion-modal-content {
        padding: 15px;
        width: 98%;
        margin: 10px;
    }

    .tetfusion-modal-footer {
        flex-direction: column;
    }

    .tetfusion-modal-footer .tetfusion-btn {
        width: 100%;
    }
}

/* Tablettes */
@media (min-width: 576px) and (max-width: 991.98px) {
    .tetfusion-plugin {
        --container-padding: 15px;
    }

    .tetfusion-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .tetfusion-profile-cover {
        height: 200px;
    }

    .tetfusion-profile-avatar {
        width: 90px;
        height: 90px;
    }

    .tetfusion-activity-actions button {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .tetfusion-chat-window {
        width: 300px;
        max-height: 400px;
        bottom: 20px;
        right: 20px;
    }

    .tetfusion-chat-toggle {
        bottom: 20px;
        right: 20px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .tetfusion-plugin {
        --container-padding: 20px;
    }

    .tetfusion-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tetfusion-profile-cover {
        height: 300px;
    }

    .tetfusion-chat-window {
        width: 350px;
        max-height: 450px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .tetfusion-plugin {
        max-width: 1400px;
        margin: 0 auto;
    }

    .tetfusion-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tetfusion-plugin {
        --light-color: #2d2d2d;
        --dark-color: #e0e0e0;
        --border-color: #404040;
        --shadow-color: rgba(0,0,0,0.3);
    }

    .tetfusion-card,
    .tetfusion-activity,
    .tetfusion-group-card,
    .tetfusion-page-card {
        background: #1a1a1a;
    }

    .tetfusion-activity-actions button {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .tetfusion-form-control {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #404040;
    }

    .tetfusion-chat-window {
        background: #1a1a1a;
    }

    .tetfusion-chat-message .message-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .tetfusion-chat-message.message-own .message-content {
        background: var(--primary-color);
        color: #fff;
    }

    .tetfusion-modal-content {
        background: #1a1a1a;
    }

    .tetfusion-comment {
        border-bottom-color: #404040;
    }

    .tetfusion-comment-form textarea {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #404040;
    }

    .tetfusion-notification {
        border-bottom-color: #404040;
    }

    .tetfusion-notification.unread {
        background: rgba(67, 97, 238, 0.1);
    }

    .tetfusion-nav {
        background: #1a1a1a;
    }

    .tetfusion-nav-item {
        color: #888;
    }

    .tetfusion-nav-item.active {
        color: var(--primary-color);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print */
@media print {
    .tetfusion-chat-window,
    .tetfusion-chat-toggle,
    .tetfusion-messages,
    .tetfusion-modal {
        display: none !important;
    }

    .tetfusion-plugin {
        padding: 0 !important;
    }

    .tetfusion-activity {
        box-shadow: none !important;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}