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

:root {
    /* Couleurs principales - Thème bleu ciel */
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    /* Couleurs de fond - Glassmorphism bleu ciel */
    --bg-color: #e0f2fe;
    --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    
    /* Couleurs de texte */
    --text-color: #0c4a6e;
    --text-light: #075985;
    --text-muted: #0284c7;
    
    /* Bordures et ombres */
    --border-color: rgba(14, 165, 233, 0.2);
    --shadow: 0 2px 8px rgba(14, 165, 233, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(14, 165, 233, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(14, 165, 233, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px rgba(14, 165, 233, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    padding-top: 70px; /* Hauteur du header fixe pour éviter que le contenu passe en dessous */
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* Header styles are now in includes/header.php */

/* Container */
.page-container {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn i {
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: rgba(100, 116, 139, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(71, 85, 105, 0.9);
    transform: translateY(-2px);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: rgba(254, 226, 226, 0.8);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: #991b1b;
    border: 1px solid rgba(254, 202, 202, 0.5);
}

.alert-success {
    background: rgba(209, 250, 229, 0.8);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: #065f46;
    border: 1px solid rgba(167, 243, 208, 0.5);
}

/* Router Stats */
.router-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.router-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-glass);
    text-align: center;
    transition: all 0.3s ease;
}

.router-stat-card:hover {
    background: var(--card-bg-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.router-stat-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.router-stat-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.25rem 0;
}

.router-stat-card p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
}

/* Router Cards */
.routers-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.router-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s ease;
}

.router-card:hover {
    background: var(--card-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.3);
}

.router-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.router-info {
    flex: 1;
    min-width: 200px;
}

.router-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.router-code {
    background: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-light);
}

.router-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.router-status i {
    font-size: 0.7rem;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.router-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(14, 165, 233, 0.2);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-width: auto;
}

.action-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.action-btn:hover {
    background: var(--bg-color);
}

.action-btn.btn-delete {
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.action-btn.btn-edit {
    color: var(--info-color);
    border-color: rgba(59, 130, 246, 0.2);
}

.action-btn.btn-edit:hover {
    background: rgba(59, 130, 246, 0.1);
}

.action-btn.btn-test {
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.2);
}

.action-btn.btn-test:hover {
    background: rgba(16, 185, 129, 0.1);
}

.router-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.detail-value {
    font-size: 1rem;
    color: var(--text-color);
}

/* No Routers */
.no-routers {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.15);
}

.no-routers i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.no-routers h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-routers p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal.show {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.3), 0 8px 32px rgba(14, 165, 233, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    position: relative;
    z-index: 10001;
    margin: 2rem auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(14, 165, 233, 0.3);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-color);
}

.modal-title i {
    font-size: 1.2rem;
}

.close-modal {
    background: rgba(87, 27, 183, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 2rem;
    cursor: pointer;
    color: #dc2626;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    opacity: 1;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #b91c1c;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Forms */
.modal-content form {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group label i {
    font-size: 0.9rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-group button[type="button"] {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0;
}

.form-group button[type="button"] i {
    font-size: 0.85rem;
}

.toggle-password-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: var(--primary-color);
}

.toggle-password-btn i {
    font-size: 0.9rem;
}

.form-info-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(6, 182, 212, 0.1);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.form-info-box h4 {
    color: #0369a1;
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-info-box h4 i {
    font-size: 0.9rem;
}

.form-info-box ul {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.6;
}

.form-info-box ul li {
    margin-bottom: 0.25rem;
}

.form-info-box code {
    background: rgba(3, 105, 161, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
    color: #0369a1;
}

/* Footer */
.main-footer {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(14, 165, 233, 0.2);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive - Tablettes et petits écrans */
@media (max-width: 1024px) {
    .header-container {
        padding: 1rem 1.5rem;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .container {
        padding: 1rem 1.5rem;
    }
    
    .page-container {
        padding: 1.5rem 1rem;
    }
}

/* Responsive - Mobiles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo i {
        font-size: 1.25rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }
    
    .nav-link {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .nav-link span,
    .nav-link i + span {
        display: none;
    }
    
    .user-menu {
        flex-direction: column;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 1rem;
        width: 100%;
        gap: 0.5rem;
    }
    
    .user-name {
        font-size: 0.85rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .page-container {
        padding: 1rem 0.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .router-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .router-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .router-info {
        width: 100%;
    }
    
    .router-stat-card {
        padding: 0.75rem;
    }
    
    .router-stat-card h3 {
        font-size: 1.25rem;
    }
    
    .router-stat-card i {
        font-size: 1.25rem;
    }
    
    .router-stat-card p {
        font-size: 0.8rem;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        max-height: 95vh;
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-content form {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-control {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .routers-list {
        gap: 1rem;
    }
    
    .router-card {
        padding: 1rem;
    }
    
    /* Tableaux responsives */
    .tickets-table,
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tickets-table thead,
    table thead {
        display: none;
    }
    
    .tickets-table tbody tr,
    table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
    }
    
    .tickets-table tbody td,
    table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .tickets-table tbody td:last-child,
    table tbody td:last-child {
        border-bottom: none;
    }
    
    .tickets-table tbody td::before,
    table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-light);
        margin-right: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .quick-action-btn {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

/* Responsive - Très petits écrans */
@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .main-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .container {
        padding: 0.75rem;
    }
    
    .page-container {
        padding: 0.75rem 0.25rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .modal-content {
        margin: 0.25rem;
        padding: 0.75rem;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .action-btn {
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .router-stat-card {
        padding: 0.75rem;
    }
    
    .router-stat-card h3 {
        font-size: 1.1rem;
    }
    
    .router-stat-card i {
        font-size: 1.1rem;
    }
    
    .router-stat-card p {
        font-size: 0.8rem;
    }
}

/* Responsive - Grands écrans */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .header-container {
        max-width: 1400px;
    }
    
    .footer-container {
        max-width: 1400px;
    }
}

/* Amélioration de l'accessibilité et du touch */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .btn,
    .action-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
}

/* Impression */
@media print {
    .main-header,
    .main-footer,
    .btn,
    .action-btn {
        display: none;
    }
    
    .page-container {
        padding: 0;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

