/* ==========================================================================
   SKYROUTE ADMIN PANEL - GLOBAL STYLES
   File: admin/assets/css/admin-style.css
   ========================================================================== */

/* --- 1. Base Styles & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    font-size: 13px;
}

a {
    text-decoration: none;
    color: #337ab7;
}

a:hover {
    text-decoration: underline;
}

/* --- 2. Top Navigation --- */
.top-nav {
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 45px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: #c2c7cc;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a.active,
.nav-links a:hover {
    color: #fff;
}

.nav-icons {
    display: flex;
    gap: 15px;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
}

.top-search input {
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    outline: none;
    width: 200px;
    font-size: 13px;
    margin-left: 20px;
}

/* --- Admin Hamburger Menu --- */
.admin-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
    z-index: 110;
}

.admin-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.admin-hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.admin-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.admin-hamburger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* --- 3. Layout Containers --- */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* --- 4. Page Toolbar & Buttons --- */
.page-toolbar {
    background: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.page-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.toolbar-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Standard Buttons */
.btn {
    background: #fff;
    border: 1px solid #ccc;
    padding: 6px 12px;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 3px;
}

.btn:hover {
    background: #f0f0f0;
}

/* Button Groups (Pagination / Filters) */
.btn-group {
    display: flex;
}

.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:first-child {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
    margin-left: 0;
}

.btn-group .btn:last-child {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.btn-group .btn.active {
    background: #337ab7;
    color: #fff;
    border-color: #2e6da4;
    z-index: 2;
}

/* Primary & Action Buttons */
.btn-primary {
    background-color: #337ab7;
    border: 1px solid #2e6da4;
    color: #fff;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #286090;
}

.btn-success {
    background-color: #5cb85c;
    border: 1px solid #4cae4c;
    color: #fff;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.btn-danger {
    background-color: #d9534f;
    border: 1px solid #d43f3a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.btn-danger:hover {
    background-color: #c9302c;
}

.btn-options {
    background: #fff;
    border: 1px solid #ccc;
    padding: 4px 10px;
    border-radius: 3px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
}

.btn-options:hover {
    background: #e6e6e6;
}

/* --- 5. Dashboard Panels --- */
.panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    margin-bottom: 20px;
}

.panel-header {
    background: #f9f9f9;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-actions {
    display: flex;
}

.action-btn {
    flex: 1;
    padding: 15px;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    color: #555;
    cursor: pointer;
    transition: background 0.2s;
}

.action-btn:last-child {
    border-right: none;
}

.action-btn:hover {
    background: #f0f4f8;
    color: #337ab7;
}

/* --- 6. Data Tables --- */
.table-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 4px 4px;
    overflow-x: auto;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

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

/* Table Column Widths & Alignment */
.col-active {
    width: 80px;
    text-align: center !important;
}

.col-balance {
    width: 150px;
}

.col-options {
    width: 100px;
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

/* --- 7. Form Layouts & Panels --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.form-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
}

.form-panel-header {
    background: #f9f9f9;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-panel-body {
    padding: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 12px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    color: #333;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #66afe9;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

/* --- 8. Badges & Text Colors --- */
.badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #fff;
    display: inline-block;
    min-width: 70px;
    text-align: center;
    font-weight: 500;
}

.badge-sent {
    background-color: #5bc0de;
}

.badge-paid {
    background-color: #5cb85c;
}

.badge-yes {
    background-color: #5cb85c;
    min-width: 50px;
}

.text-red {
    color: #d9534f !important;
    font-weight: 500;
}

.text-blue {
    color: #337ab7;
}

/* --- 9. Modal Popup Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 600px;
    max-width: 90%;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    background: #f9f9f9;
}

.close-btn {
    cursor: pointer;
    color: #999;
    font-size: 18px;
    border: none;
    background: transparent;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
    background: #f9f9f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

/* --- Tablet (max-width: 768px) --- */
@media (max-width: 768px) {

    /* Navigation */
    .top-nav {
        flex-wrap: wrap;
        height: auto;
        min-height: 45px;
        padding: 8px 16px;
        position: relative;
    }

    .admin-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 8px 0;
        order: 3;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a {
        padding: 10px 4px;
        font-size: 14px;
    }

    .nav-icons {
        gap: 10px;
        font-size: 14px;
    }

    /* Containers */
    .container {
        margin: 12px auto;
        padding: 0 12px;
    }

    /* Grid layouts */
    .grid-2-col {
        grid-template-columns: 1fr;
    }

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

    /* Page toolbar */
    .page-toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding: 12px 14px;
    }

    .toolbar-actions {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .toolbar-actions input[type="text"] {
        width: 100% !important;
        min-width: 0;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    /* Quick Actions */
    .quick-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1 1 45%;
        padding: 12px 8px;
        font-size: 12px;
        border-bottom: 1px solid #e0e0e0;
    }

    /* Modal */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Responsive inline grid overrides for modals */
    .modal-body [style*="grid-template-columns: 1fr 1fr 1fr"],
    .modal-body [style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .modal-body [style*="grid-template-columns: 1fr 1fr"],
    .modal-body [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Data table responsive */
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .table-container {
        border-radius: 4px;
    }
}

/* --- Mobile (max-width: 480px) --- */
@media (max-width: 480px) {

    body {
        font-size: 12px;
    }

    .top-nav {
        padding: 6px 12px;
    }

    .container {
        margin: 8px auto;
        padding: 0 8px;
    }

    .page-title {
        font-size: 16px;
    }

    .page-toolbar {
        padding: 10px;
    }

    .toolbar-actions {
        gap: 6px;
    }

    /* Buttons */
    .btn,
    .btn-primary,
    .btn-success,
    .btn-danger {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Panels */
    .panel-header {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Quick actions stacked */
    .action-btn {
        flex: 1 1 100%;
        border-right: none;
    }

    /* Table */
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* Badge */
    .badge {
        font-size: 10px;
        min-width: 55px;
        padding: 3px 6px;
    }

    /* Modal */
    .modal-header {
        font-size: 14px;
        padding: 12px 14px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-footer {
        padding: 10px 14px;
    }

    /* Form */
    .form-panel-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .form-panel-body {
        padding: 12px;
    }

    .form-group label {
        font-size: 11px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="date"],
    .form-group select {
        font-size: 13px;
        padding: 8px;
    }
}