/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f2f2f7;
    color: #1d1d1f;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.login-header p {
    color: #8e8e93;
    font-size: 16px;
    margin-bottom: 32px;
}

.login-form {
    margin-bottom: 24px;
}

.login-form .form-group {
    margin-bottom: 24px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e5ea;
    border-radius: 12px;
    background: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #0056CC;
}

.login-btn:active {
    transform: scale(0.98);
}

.login-footer {
    color: #8e8e93;
    font-size: 14px;
}

.login-footer p {
    margin: 0;
}

/* App container */
.app {
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f2f2f7;
}

/* Header */
.header {
    background: #ffffff;
    padding: 20px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5ea;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info {
    margin-top: 4px;
}

.user-description {
    font-size: 14px;
    color: #8e8e93;
    font-weight: 500;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
}

.add-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: #007AFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.add-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
}

.add-btn:active {
    transform: scale(0.95);
}

.add-icon {
    color: white;
    font-size: 24px;
    font-weight: 300;
}

.logout-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: #ff3b30;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.logout-btn:hover {
    background: #d70015;
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.95);
}

.logout-icon {
    font-size: 20px;
}

/* Navigation */
.nav {
    background: #ffffff;
    display: flex;
    padding: 8px 20px 12px;
    border-bottom: 1px solid #e5e5ea;
    gap: 8px;
}

.nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8e8e93;
}

.nav-item.active {
    background: #007AFF;
    color: white;
}

.nav-item:hover:not(.active) {
    background: #f2f2f7;
    color: #1d1d1f;
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* Main content */
.main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    background: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.filter-btn {
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f2f2f7;
}

/* Demandes list */
.demandes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demande-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e5e5ea;
}

.demande-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.demande-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.demande-nom {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.demande-entreprise {
    font-size: 14px;
    color: #8e8e93;
}

.demande-statut {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.statut-nouvelle {
    background: #e3f2fd;
    color: #1976d2;
}

.statut-en_cours {
    background: #fff3e0;
    color: #f57c00;
}

.statut-terminee {
    background: #e8f5e8;
    color: #2e7d32;
}

.statut-annulee {
    background: #ffebee;
    color: #d32f2f;
}

.demande-priorite {
    margin-bottom: 12px;
}

.priorite-basse {
    color: #8e8e93;
}

.priorite-normale {
    color: #007AFF;
}

.priorite-haute {
    color: #ff9500;
}

.priorite-urgente {
    color: #ff3b30;
}

.demande-contenu {
    color: #1d1d1f;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.demande-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #8e8e93;
}

.demande-canal {
    text-transform: capitalize;
}

/* Stats */
.stats-container h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5ea;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #007AFF;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #8e8e93;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e5ea;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: #f2f2f7;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #8e8e93;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e5e5ea;
    color: #1d1d1f;
}

/* Form */
.demande-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    background: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e5e5ea;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0056CC;
}

.btn-secondary {
    background: #f2f2f7;
    color: #1d1d1f;
    border: 1px solid #e5e5ea;
}

.btn-secondary:hover {
    background: #e5e5ea;
}

/* Demande detail */
.demande-detail {
    padding: 24px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.detail-section p {
    color: #1d1d1f;
    line-height: 1.5;
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.detail-item {
    background: #f2f2f7;
    padding: 12px;
    border-radius: 8px;
}

.detail-item strong {
    display: block;
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-meta {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }
    
    .modal.active {
        align-items: flex-end;
        padding: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.demande-card {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f2f2f7;
}

::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8e8e93;
}
