/* OVH Call Forward Manager - Main Styles */

:root {
    --primary: #007bff;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --ovh-blue: #0050aa;
    --ovh-light-blue: #00a8e6;
}

/* General Styles */
body {
    background-color: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Auth Page Styles */
.auth-page {
    background: linear-gradient(135deg, var(--ovh-blue) 0%, var(--ovh-light-blue) 100%);
    min-height: 100vh;
}

.auth-container {
    padding: 4rem 0;
}

.auth-container .card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.375rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--ovh-blue) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ovh-blue) 0%, var(--primary) 100%);
}

/* Badges */
.badge {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #e0e6ed;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
    transform: translateY(-1px);
}

.input-group-text {
    border-radius: 0.5rem;
    border: 1px solid #e0e6ed;
    background-color: #f8f9fa;
    color: var(--secondary);
}

/* Table */
.table th {
    font-weight: 600;
    color: var(--dark);
    border-top: none;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0.5rem;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--light));
}

.timeline-item {
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 1;
}

.timeline-content {
    background: rgba(var(--bs-light-rgb), 0.5);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.1);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.75rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(var(--bs-success-rgb), 0.1);
    border-left-color: var(--success);
    color: #0f5132;
}

.alert-danger {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
    border-left-color: var(--danger);
    color: #842029;
}

.alert-warning {
    background-color: rgba(var(--bs-warning-rgb), 0.1);
    border-left-color: var(--warning);
    color: #664d03;
}

.alert-info {
    background-color: rgba(var(--bs-info-rgb), 0.1);
    border-left-color: var(--info);
    color: #055160;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.active {
    background-color: rgba(var(--bs-success-rgb), 0.1);
    color: var(--success);
}

.status-indicator.inactive {
    background-color: rgba(var(--bs-secondary-rgb), 0.1);
    color: var(--secondary);
}

.status-indicator.error {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
    color: var(--danger);
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* Quick preset buttons for phone shortcuts */
.btn-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    padding: 0.5rem 0.75rem;
    word-break: break-all;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.btn-preset small {
    font-size: 0.7rem;
    line-height: 1.1;
    margin-top: 0.25rem;
    opacity: 0.8;
    display: block;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .btn-preset {
        min-height: 85px;
        min-width: 90px;
        padding: 0.75rem 0.5rem;
        margin: 0.25rem;
    }
    
    .btn-preset small {
        font-size: 0.65rem;
    }
    
    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }
    .auth-container {
        padding: 1.5rem 1rem;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
    
    .card {
        border-radius: 1.25rem;
        margin: 0;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .card-body {
        padding: 2rem !important;
    }
    
    .form-control,
    .form-control-lg {
        font-size: 18px !important;
        min-height: 65px;
        padding: 1.25rem 1rem;
        border-radius: 0.75rem;
        border: 2px solid #e9ecef;
    }
    
    .input-group-text {
        padding: 1.25rem 1rem;
        font-size: 1.2rem;
        min-height: 65px;
        border-radius: 0.75rem 0 0 0.75rem;
        border: 2px solid #e9ecef;
        border-right: none;
        background-color: #f8f9fa;
    }
    
    .btn-lg {
        padding: 1.25rem 2rem;
        font-size: 1.3rem;
        min-height: 65px;
        border-radius: 0.75rem;
        font-weight: 600;
    }
    
    .form-label {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: #495057;
    }
    
    h1, h4 {
        font-size: 1.5rem !important;
    }
    
    .fa-phone-alt {
        font-size: 2.5rem !important;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-marker {
        left: -1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .navbar-nav {
        padding-top: 1rem;
    }
    
    .auth-container {
        padding: 1rem 0;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
    
    /* Zoom sur les champs en focus */
    .form-control:focus {
        transform: none; /* Évite le zoom automatique sur iOS */
        -webkit-transform: none;
    }
}

/* Optimisations spécifiques pour très petits écrans */
@media (max-width: 576px) {
    .auth-container {
        padding: 1rem 0.5rem;
    }
    
    .form-control, 
    .form-control-lg {
        font-size: 16px !important; /* Évite le zoom sur iOS */
        min-height: 55px;
        padding: 0.875rem;
    }
    
    .input-group-text {
        font-size: 1rem;
        min-height: 55px;
        padding: 0.875rem;
    }
    
    .btn-lg {
        font-size: 1.1rem;
        padding: 0.875rem 1.5rem;
        min-height: 55px;
    }
}

/* PWA Styles */
.pwa-install-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1050;
}

.pwa-install-banner.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #1a1d23;
        --bs-body-color: #e9ecef;
        --bs-border-color: #343a40;
    }
    
    .card {
        background-color: #2d3436;
        color: #e9ecef;
    }
    
    .table {
        --bs-table-bg: transparent;
        color: #e9ecef;
    }
    
    .form-control {
        background-color: #3a3f44;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .form-control:focus {
        background-color: #3a3f44;
        border-color: var(--primary);
        color: #e9ecef;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer,
    .pwa-install-banner {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    body {
        background: white;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .alert {
        border: 2px solid currentColor;
    }
}