/* Variables CSS harmonisées */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #ff4d94;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --border-radius: 12px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fb;
    overflow-x: hidden;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-info span {
    font-weight: 500;
    font-size: 0.9rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section Support */
.hero-support {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero-support::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(23, 162, 184, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(40, 167, 69, 0.1) 0%, transparent 50%);
}

.hero-container {
    position: relative;
    z-index: 2;
}

.hero-content {
    text-align: center;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    padding: 0 10px;
}

.hero-title .highlight {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    margin-bottom: 1.5rem;
    opacity: 0.9;
    padding: 0 10px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.8rem;
    max-width: 100%;
}

.stat-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 800;
    color: #4ade80;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Section principale */
.main-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

/* Sidebar */
.sidebar {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--dark-color);
    font-size: 0.95rem;
}

.sidebar-menu a:hover {
    background-color: #f0f2f5;
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background-color: #eef2ff;
    color: var(--primary-color);
    font-weight: 500;
}

.support-categories h4 {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: var(--gray-color);
    font-weight: 600;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 0.3rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    color: var(--dark-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.category-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* Contenu principal */
.content-area {
    min-height: 60vh;
    width: 100%;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h2 {
    color: var(--primary-color);
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.header-subtitle {
    color: var(--gray-color);
    font-size: 0.9rem;
    font-weight: 400;
}

.btn {
    padding: 0.7rem 1.2rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--box-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.3);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--dark-color);
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* Chat Section */
.chat-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f0f2f5;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Liste des tickets */
.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.ticket-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
    transform: translateY(-2px);
}

.ticket-card.unread {
    background: rgba(106, 17, 203, 0.03);
    border-left: 4px solid var(--primary-color);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.8rem;
    gap: 1rem;
}

.ticket-info {
    flex: 1;
}

.ticket-id {
    font-size: 0.75rem;
    color: var(--gray-color);
    font-weight: 500;
}

.ticket-subject {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0.3rem 0;
}

.ticket-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.open {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.status-badge.answered {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-badge.closed {
    background: rgba(108, 117, 125, 0.1);
    color: var(--gray-color);
}

.priority-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-badge.normale {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.priority-badge.urgente {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.category-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(106, 17, 203, 0.1);
    color: var(--primary-color);
}

.ticket-preview {
    color: var(--gray-color);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--gray-color);
    padding-top: 0.8rem;
    border-top: 1px solid #f0f2f5;
}

.ticket-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.message-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Formulaire */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: var(--gray-color);
    font-size: 0.8rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.conversation-subtitle {
    font-size: 0.85rem;
    color: var(--gray-color);
    font-weight: 400;
    margin-top: 0.3rem;
}

.modal-close {
    background: white;
    border: 1px solid #ddd;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
    transition: var(--transition);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #f0f2f5;
    color: var(--dark-color);
}

.modal-body {
    padding: 1.2rem;
}

.chat-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 180px);
}

.modal-actions {
    padding: 1.2rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.8rem;
    background: #f8f9fa;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    min-height: 400px;
    max-height: calc(90vh - 300px);
}

.message-bubble {
    margin-bottom: 1.2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.user {
    display: flex;
    justify-content: flex-end;
}

.message-bubble.support {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 1rem;
    border-radius: var(--border-radius);
    position: relative;
}

.message-bubble.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.message-bubble.support .message-content {
    background: white;
    color: var(--dark-color);
    border: 1px solid #e0e0e0;
}

.message-author {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-author i {
    font-size: 0.9rem;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.message-bubble.user .message-time {
    text-align: right;
}

/* Input de message */
.message-input-container {
    padding: 1.2rem;
    background: white;
    border-top: 1px solid #eee;
}

.message-input {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

.message-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 3000;
    animation: slideIn 0.3s ease;
    max-width: calc(100% - 40px);
    font-size: 0.9rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

.notification.info {
    background: var(--info-color);
    color: white;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-color);
}

.loading i {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-color);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: #ddd;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: white;
}

.footer-section li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ddd;
    font-size: 0.9rem;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 0.85rem;
}

/* Utilitaires */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 1.5rem 0;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        z-index: 99;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-links a {
        color: var(--dark-color);
        padding: 0.9rem;
        border-radius: var(--border-radius);
    }

    .nav-links a:hover {
        background-color: #f0f2f5;
    }

    .nav-links a.active {
        background-color: #eef2ff;
        color: var(--primary-color);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .hero-support {
        padding: 1.5rem 0;
    }

    .hero-stats {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.6rem;
    }

    .stat-box {
        padding: 0.7rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .ticket-card {
        padding: 1rem;
    }

    .message-content {
        max-width: 95%;
    }

    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 0.9rem;
        font-size: 0.85rem;
    }
} 0.8rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .ticket-header {
        flex-direction: column;
        align-items: start;
    }

    .ticket-badges {
        width: 100%;
    }

    .message-content {
        max-width: 85%;
    }

    .modal-content {
        max-width: 95%;
        margin: 0.5rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-actions {
        padding: 1rem;
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .messages-container {
        min-height: 300px;
        max-height: calc(90vh - 250px);
    }

    .user-info span {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-box {
        padding: