/**
 * Aircraft Management SAAS - Custom Styles
 */

/* General Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
}

/* Landing Page */
.landing-page {
    min-height: 100vh;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 500px;
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
    font-size: 1.2rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

/* Dashboard Cards */
.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.text-xs {
    font-size: .7rem;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

/* Tables */
.table {
    font-size: 0.9rem;
}

.table thead th {
    border-bottom: 2px solid #e3e6f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fc;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.25rem 0.5rem;
    margin: 0 0.1rem;
}

/* Badges */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 0.35rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Modals */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.form-control,
.form-select {
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border-radius: 0.35rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Login/Register Pages */
.min-vh-100 {
    min-height: 100vh;
}

/* Shadows */
.shadow {
    box-shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .15) !important;
}

.shadow-sm {
    box-shadow: 0 .125rem .25rem 0 rgba(58, 59, 69, .2) !important;
}

/* Loading Spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar .card {
        margin: 1rem;
    }

    .sidebar .card-body {
        padding: 0.75rem;
    }

    main {
        padding: 1rem !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    .navbar-toggler {
        display: block !important;
    }

    .navbar-brand {
        margin-left: 50px; /* Space for hamburger menu */
    }

    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        border: none;
    }

    .table {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .table thead th {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .table tbody td {
        padding: 0.5rem;
    }

    /* Dashboard cards */
    .row.mb-4 .col-md-3 {
        margin-bottom: 1rem;
    }

    .card.shadow h-100 {
        min-height: auto;
        margin-bottom: 1rem;
    }

    /* Form improvements */
    .form-control, .form-select {
        font-size: 1rem; /* Prevent zoom on iOS */
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* Button groups */
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* DataTables responsive */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        margin-top: 1rem;
    }

    /* Charts responsive */
    .chart-container {
        position: relative;
        height: 300px;
        width: 100%;
    }

    /* Settings tabs */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Hide certain elements on mobile */
    .d-mobile-none {
        display: none !important;
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .container-fluid {
        padding: 0;
    }

    main {
        padding: 0.5rem !important;
    }

    .card-header h6 {
        font-size: 1rem;
    }

    .btn-toolbar .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Stack metrics cards vertically */
    .row.mb-4 .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Make tables even more compact */
    .table {
        font-size: 0.75rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.25rem;
    }

    /* Modal full screen on very small screens */
    .modal-dialog {
        margin: 0;
        max-width: none;
        width: 100%;
        height: 100%;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
    }

    /* Form labels and inputs */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-control, .form-select {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

.card {
    animation: fadeIn 0.5s ease;
}

/* Feature Icons */
.feature-icon {
    width: 60px;
    height: 60px;
}

/* List Groups */
.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: #f8f9fc;
}

/* Utility Classes */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cursor-pointer {
    cursor: pointer;
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        display: none !important;
    }

    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}
