* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #7c3aed;
    --accent-color: #8b5cf6;
    --success-color: #16a34a;
    --warning-color: #ca8a04;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --text-color: #1e293b;
    --text-muted: #475569;
    --border-color: #cbd5e1;
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    transition: all 0.3s;
    font-weight: 500;
    border-radius: 8px;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.user-name {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
    filter: brightness(1.05);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: var(--gradient-dark);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.05rem;
    margin: 1rem auto 2rem;
    max-width: 700px;
    line-height: 1.7;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: linear-gradient(to bottom, white 0%, var(--bg-color) 100%);
}

.about-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-weight: 700;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: var(--bg-color);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

.feature-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: var(--primary-color);
    color: white;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.cta-section p {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.contact-info {
    margin-top: 2rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.2rem 2rem;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-info p {
    margin: 0;
}

.email-copy {
    color: white;
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.email-copy:hover {
    opacity: 0.8;
}

.email-copy.copied::after {
    content: '✓ Copié !';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    animation: fadeOut 2s forwards;
}

@keyframes fadeOut {
    0%, 50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

/* Legal Content */
.legal-content {
    background: var(--card-bg);
    padding: 3.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 950px;
    margin: 0 auto;
}

.legal-content h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    font-size: 2.8rem;
    font-weight: 800;
}

.legal-content h2 {
    color: var(--text-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
}

.legal-content p {
    line-height: 1.9;
    margin-bottom: 1.2rem;
    color: var(--text-color);
    font-size: 1.05rem;
}

.legal-content ul {
    margin-left: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.legal-content ul li {
    margin-bottom: 0.7rem;
    color: var(--text-color);
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.legal-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Page Container */
.page-container {
    padding: 4rem 0;
    min-height: 80vh;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .hero-description {
        font-size: 1.05rem;
    }

    .features h2,
    .cta-section h2,
    .about-section h2 {
        font-size: 2.2rem;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .legal-content {
        padding: 2rem;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Dark Mode */
body.dark-mode {
    --text-color: #f8fafc;
    --text-muted: #cbd5e1;
    --border-color: #475569;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --secondary-color: #a78bfa;
    --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
}

body.dark-mode .navbar {
    background: var(--card-bg);
    border-bottom-color: #334155;
}

body.dark-mode .hero {
    background: var(--gradient-dark);
}

body.dark-mode .feature-card,
body.dark-mode .about-content,
body.dark-mode .legal-content,
body.dark-mode .stat-card {
    background: var(--card-bg);
    color: var(--text-color);
}

body.dark-mode .about-section {
    background: linear-gradient(to bottom, var(--bg-color) 0%, #1e293b 100%);
}

body.dark-mode .features {
    background: var(--bg-color);
}

body.dark-mode .cta-section {
    background: var(--gradient-primary);
}

body.dark-mode .footer {
    background: #0f172a;
    border-top-color: #334155;
}

body.dark-mode .tickets-table th {
    background: var(--bg-color);
}

body.dark-mode .tickets-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.1);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.dark-mode-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dark-mode-toggle i {
    font-size: 1.2rem;
    color: white;
}

/* Auth Pages - Login/Register */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color);
}

.auth-box {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.auth-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.form-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: var(--bg-color);
    border-color: var(--border-color);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    background: var(--card-bg);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid;
}

.alert i {
    font-size: 1.2rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #dc2626;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #3b82f6;
}

body.dark-mode .alert-error {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border-color: #dc2626;
}

body.dark-mode .alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: #10b981;
}

body.dark-mode .alert-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: #3b82f6;
}

/* Dashboard */
.dashboard-container {
    padding: 2rem 0;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: var(--text-color);
    font-weight: 700;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--primary-color);
}

.stat-card.stat-open {
    border-left: 3px solid var(--info-color);
}

.stat-card.stat-progress {
    border-left: 3px solid var(--warning-color);
}

.stat-card.stat-resolved {
    border-left: 3px solid var(--success-color);
}

.stat-card.stat-closed {
    border-left: 3px solid var(--text-muted);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Tables */
.tickets-table {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.tickets-table table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table th,
.tickets-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.tickets-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tickets-table tbody tr {
    transition: background-color 0.15s;
}

.tickets-table tbody tr:hover {
    background: var(--bg-color);
}

.tickets-table tbody tr:last-child td {
    border-bottom: none;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status-ouvert {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status-en_cours {
    background: #fef3c7;
    color: #92400e;
}

.badge-status-resolu {
    background: #d1fae5;
    color: #065f46;
}

.badge-status-ferme {
    background: #e5e7eb;
    color: #6b7280;
}

.badge-priority-basse {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-priority-normale {
    background: #dbeafe;
    color: #1e40af;
}

.badge-priority-haute {
    background: #fed7aa;
    color: #9a3412;
}

.badge-priority-urgente {
    background: #fee2e2;
    color: #991b1b;
}

.badge-admin {
    background: var(--primary-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Ticket Detail */
.ticket-header {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-left: 5px solid var(--primary-color);
}

.ticket-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
}

.ticket-meta {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.ticket-badges {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.ticket-description {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.ticket-description h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.3rem;
}

.ticket-description p {
    line-height: 1.9;
    color: var(--text-color);
}

/* Messages */
.messages-section {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.messages-section h3 {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.3rem;
}

.no-messages {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem;
    font-style: italic;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.message {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s;
}

.message:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.message-admin {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
    border-left-color: var(--primary-color);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.message-header strong {
    color: var(--text-color);
    font-weight: 700;
}

.message-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

.message-content {
    line-height: 1.8;
    color: var(--text-color);
}

.message-form {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 3px solid var(--border-color);
}

.message-form h4 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
}

/* Admin Actions */
.admin-actions {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 1.8rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
}

.filter-group select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Responsive pour dashboard */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ticket-header {
        flex-direction: column;
    }

    .tickets-table {
        overflow-x: auto;
    }

    .tickets-table table {
        min-width: 800px;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .dark-mode-toggle {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
}
