/**
 * Ahalussufah Travel & Tours LTD - Custom Styles
 */

/* Root Variables */
:root {
    --primary-color: #c9a34a;
    --primary-dark: #8b6a1f;
    --secondary-color: #173c35;
    --secondary-soft: #244f47;
    --accent-color: #a62d2d;
    --success-color: #1d6b4d;
    --danger-color: #a62d2d;
    --warning-color: #d9ad4c;
    --info-color: #173c35;
    --bg-soft: #f6f0e6;
    --surface-color: #ffffff;
    --text-color: #1f2d29;
    --muted-color: #5f6a65;
    --sidebar-width: 250px;
}

/* General Styles */
body {
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #edf6ff 0%, #dfeef6 25%, #f7f0e6 100%);
    color: var(--text-color);
    overflow-x: hidden;
    isolation: isolate;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 209, 102, 0.32), transparent 22%),
        radial-gradient(circle at bottom right, rgba(9, 70, 99, 0.2), transparent 28%),
        linear-gradient(135deg, rgba(12, 30, 40, 0.06), rgba(255, 255, 255, 0.1));
    z-index: -3;
}

.travel-sky {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 20%, rgba(77, 206, 255, 0.25), transparent 20%),
        radial-gradient(circle at 78% 16%, rgba(98, 110, 255, 0.22), transparent 23%),
        radial-gradient(circle at 60% 72%, rgba(70, 211, 191, 0.13), transparent 22%),
        linear-gradient(180deg, rgba(3, 12, 22, 0.98) 0%, rgba(8, 21, 33, 0.97) 28%, rgba(12, 30, 45, 0.92) 100%);
    box-shadow: inset 0 0 120px rgba(94, 160, 255, 0.12);
}

.travel-sky::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
    opacity: 0.75;
    animation: gridShift 18s linear infinite;
}

.travel-sky::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(126, 220, 255, 0.24) 35%, rgba(178, 236, 255, 0.08) 50%, transparent 100%);
    transform: translateX(-120%);
    animation: scanBeam 14s ease-in-out infinite;
}

.grid {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(111, 220, 255, 0.22), transparent 48%);
    opacity: 0.9;
}

.digital-ring {
    position: absolute;
    border: 1px solid rgba(126, 232, 255, 0.45);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(90, 167, 255, 0.2), inset 0 0 22px rgba(126, 232, 255, 0.08);
    animation: pulseRing 10s ease-in-out infinite;
}

.ring-1 {
    width: 360px;
    height: 360px;
    top: 12%;
    left: 18%;
}

.ring-2 {
    width: 560px;
    height: 560px;
    right: 7%;
    bottom: 7%;
    animation-delay: 3.5s;
}

.pulse {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(179, 255, 244, 1) 0%, rgba(82, 197, 255, 0.9) 28%, rgba(82, 197, 255, 0.06) 100%);
    box-shadow: 0 0 26px rgba(92, 194, 255, 1);
    animation: pulseDot 7s ease-in-out infinite alternate;
}

.pulse-1 { top: 28%; left: 26%; }
.pulse-2 { right: 18%; bottom: 22%; animation-delay: 2s; }

.orb {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(136, 227, 255, 0.9);
    box-shadow: 0 0 18px rgba(136, 227, 255, 0.8), 0 0 32px rgba(81, 208, 255, 0.7);
    animation: driftOrb 12s ease-in-out infinite alternate;
}

.orb-1 { top: 20%; left: 42%; }
.orb-2 { top: 52%; right: 20%; animation-delay: 2s; }
.orb-3 { bottom: 18%; left: 60%; animation-delay: 4s; }

.dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(179, 241, 255, 0.88);
    box-shadow: 0 0 12px rgba(179, 241, 255, 0.7);
    animation: floatDot 12s linear infinite;
}

.dot-1 { top: 26%; left: 30%; }
.dot-2 { top: 18%; right: 28%; animation-delay: 2s; }
.dot-3 { top: 44%; left: 64%; animation-delay: 4s; }
.dot-4 { bottom: 30%; left: 22%; animation-delay: 5s; }
.dot-5 { bottom: 20%; right: 30%; animation-delay: 3s; }
.dot-6 { top: 58%; left: 48%; animation-delay: 6s; }

.route {
    position: absolute;
    border: 1px solid rgba(110, 236, 255, 0.38);
    border-left: 0;
    border-radius: 50%;
    opacity: 0.8;
    transform-origin: center;
    animation: routeFlow 16s ease-in-out infinite alternate;
}

.route-1 {
    width: 540px;
    height: 190px;
    top: 18%;
    left: 12%;
    transform: rotate(-18deg);
}

.route-2 {
    width: 440px;
    height: 170px;
    right: 12%;
    top: 42%;
    transform: rotate(14deg);
    animation-delay: 2s;
}

.route-3 {
    width: 620px;
    height: 220px;
    bottom: 15%;
    left: 18%;
    transform: rotate(-6deg);
    animation-delay: 4s;
}

.plane {
    position: absolute;
    width: 120px;
    height: 30px;
    background: linear-gradient(90deg, rgba(255,255,255,0.89), rgba(124, 219, 255, 0.26));
    clip-path: polygon(0% 50%, 22% 36%, 37% 18%, 52% 0%, 66% 44%, 100% 50%, 66% 56%, 52% 100%, 37% 82%, 22% 64%);
    box-shadow: 0 0 18px rgba(103, 214, 255, 0.38);
    opacity: 0.9;
    transform: rotate(-10deg);
    animation: planeTravel 24s linear infinite;
}

.plane::before {
    content: "";
    position: absolute;
    inset: 10px 12px 10px 18px;
    background: linear-gradient(90deg, rgba(83, 196, 255, 0.9), rgba(173, 251, 255, 0.38));
    clip-path: polygon(0% 50%, 22% 38%, 40% 20%, 60% 50%, 40% 80%, 22% 62%);
    border-radius: 10px;
}

.plane-1 { top: 12%; left: -15%; animation-delay: 0s; }
.plane-2 { top: 26%; left: -18%; animation-delay: 5s; animation-duration: 28s; }
.plane-3 { top: 44%; left: -12%; animation-delay: 11s; animation-duration: 26s; }
.plane-4 { top: 62%; left: -18%; animation-delay: 17s; animation-duration: 32s; }
.plane-5 { top: 78%; left: -14%; animation-delay: 22s; animation-duration: 30s; }

@keyframes planeTravel {
    0% {
        transform: translate3d(-8vw, 0, 0) rotate(-8deg) scale(0.85);
        opacity: 0;
    }
    15% {
        opacity: 0.9;
    }
    50% {
        transform: translate3d(42vw, -48px, 0) rotate(6deg) scale(1);
    }
    100% {
        transform: translate3d(122vw, -92px, 0) rotate(12deg) scale(1.15);
        opacity: 0;
    }
}

@keyframes gridShift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(30px, 18px, 0) scale(1.06);
    }
}

@keyframes scanBeam {
    0% {
        transform: translateX(-100%);
    }
    52% {
        transform: translateX(120%);
    }
    100% {
        transform: translateX(140%);
    }
}

@keyframes pulseRing {
    0%, 100% {
        transform: scale(0.96);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes pulseDot {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.4);
        opacity: 1;
    }
}

@keyframes driftOrb {
    0% {
        transform: translateY(0) scale(0.9);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-24px) scale(1.3);
        opacity: 1;
    }
}

@keyframes floatDot {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-14px) scale(1.4);
        opacity: 1;
    }
    100% {
        transform: translateY(8px) scale(0.9);
        opacity: 0.4;
    }
}

@keyframes routeFlow {
    0% {
        opacity: 0.35;
        filter: blur(0.4px);
    }
    100% {
        opacity: 0.9;
        filter: blur(0.2px);
    }
}

/* Make text dark for better readability, but preserve Bootstrap colors */
body,
h1, h2, h3, h4, h5, h6,
p, span, li, td, th, label,
.form-label,
.card-header,
.page-header h1,
.breadcrumb-item,
.breadcrumb-item a,
.stat-label,
.quick-action-btn {
    color: #212529;
}

/* Preserve navbar colors */
.navbar *,
.navbar-brand,
.navbar-brand i {
    color: inherit !important;
}

.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: #fff !important;
}

.navbar-dark .navbar-brand i {
    color: var(--primary-color) !important;
}

.navbar-dark.bg-primary,
.bg-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0f2a25 100%) !important;
}

/* Preserve stat card colors */
.stat-card,
.stat-card *,
.stat-card .stat-value,
.stat-card .stat-label {
    color: #fff !important;
}

/* Preserve badge colors */
.badge,
.badge-pending,
.badge-submitted,
.badge-processing,
.badge-approved,
.badge-rejected,
.badge-cancelled,
.badge-confirmed,
.badge-checked_in,
.badge-checked_out {
    color: inherit !important;
}

.badge-pending {
    color: #000 !important;
}

/* Preserve profile header colors */
.profile-header,
.profile-header * {
    color: #fff !important;
}

/* Preserve login card heading color */
.login-card .card-header h3 {
    color: var(--secondary-color) !important;
}

/* Main Content Area */
.main-content {
    margin-top: 70px;
    padding: 24px 20px 30px;
    min-height: calc(100vh - 130px);
    background: linear-gradient(180deg, rgba(246, 240, 230, 0.3) 0%, rgba(255, 255, 255, 0.75) 100%);
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 8px 24px rgba(17, 29, 26, 0.18);
    border-bottom: 1px solid rgba(201, 163, 74, 0.25);
    background: linear-gradient(135deg, rgba(23, 60, 53, 0.98) 0%, rgba(13, 34, 31, 0.98) 100%) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: 0.02em;
}

.brand-logo {
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
    max-height: 42px;
    width: auto;
}

.brand-text {
    white-space: nowrap;
}

.navbar-brand i {
    color: var(--primary-color);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(201, 163, 74, 0.18);
    border-radius: 5px;
    color: #fff !important;
}

/* Cards */
.card {
    border: 1px solid rgba(23, 60, 53, 0.08);
    box-shadow: 0 0.65rem 1.5rem rgba(23, 60, 53, 0.08);
    margin-bottom: 1.5rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.card-header {
    background: linear-gradient(135deg, rgba(201, 163, 74, 0.14), rgba(23, 60, 53, 0.04));
    border-bottom: 1px solid rgba(23, 60, 53, 0.08);
    font-weight: 600;
    color: var(--secondary-color);
}

/* Dashboard Cards */
.stat-card {
    border-radius: 0.9rem;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 0.7rem 1.5rem rgba(21, 31, 39, 0.12);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background-color: rgba(255, 255, 255, 0.22);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stat Card Colors */
.stat-card.customers {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0f2a25 100%);
}

.stat-card.visas {
    background: linear-gradient(135deg, var(--primary-color) 0%, #af7a1d 100%);
}

.stat-card.tickets {
    background: linear-gradient(135deg, var(--accent-color) 0%, #8c2a2a 100%);
}

.stat-card.revenue {
    background: linear-gradient(135deg, var(--success-color) 0%, #124d39 100%);
}

/* Tables */
.table {
    vertical-align: middle;
}

.table thead th {
    background: linear-gradient(180deg, #f7efe0 0%, #f1e6d2 100%);
    border-bottom: 2px solid rgba(23, 60, 53, 0.12);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(201, 163, 74, 0.08);
}

/* Status Badges */
.badge {
    font-weight: 600;
    padding: 0.45em 0.8em;
    border-radius: 0.45rem;
}

.badge-pending {
    background-color: #f4d27b;
    color: #2a2108;
}

.badge-submitted {
    background-color: #c7e3de;
    color: var(--secondary-color);
}

.badge-processing {
    background-color: #d9a32c;
    color: #1d1d1d;
}

.badge-approved {
    background-color: #1d6b4d;
}

.badge-rejected {
    background-color: #a62d2d;
}

.badge-cancelled {
    background-color: #7d7d7d;
}

.badge-confirmed {
    background-color: #2d7a5c;
}

.badge-checked_in {
    background-color: #9db4aa;
    color: var(--secondary-color);
}

.badge-checked_out {
    background-color: #6d7a76;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(201, 163, 74, 0.18);
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    color: #1c1c1c;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-color), #7d2020);
    border-color: var(--accent-color);
}

.btn-outline-primary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
    padding: 1.3rem 1.5rem;
    border: 1px solid rgba(23, 60, 53, 0.08);
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 240, 230, 0.94));
    box-shadow: 0 12px 24px rgba(23, 60, 53, 0.06);
    border-left: 5px solid var(--primary-color);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
}

.page-header .breadcrumb-item.active {
    color: var(--secondary-color);
    font-weight: 600;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(23, 60, 53, 0.98) 0%, rgba(18, 42, 39, 0.96) 50%, rgba(201, 163, 74, 0.82) 100%);
    border: none;
    border-radius: 1rem;
    color: #fff;
    box-shadow: 0 1rem 2rem rgba(17, 29, 26, 0.16);
    overflow: hidden;
}

.dashboard-hero .card-body {
    padding: 1.5rem 1.6rem;
}

.dashboard-hero .eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.7rem;
}

.dashboard-hero h2 {
    color: #fff;
    font-weight: 700;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.metric-pill {
    min-width: 110px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
    backdrop-filter: blur(4px);
}

.metric-pill span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.1rem;
}

.metric-pill strong {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(23, 60, 53, 1) 0%, rgba(134, 43, 43, 0.9) 50%, rgba(201, 163, 74, 0.95) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(201, 163, 74, 0.3);
}

.login-card .card-header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: none;
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.login-card .card-header h3 {
    color: var(--secondary-color);
    font-weight: 700;
}

.login-card .card-body {
    padding: 1rem 2rem 2rem;
}

.login-logo {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    max-width: 220px;
    height: auto;
    display: block;
}

/* Quick Actions */
.quick-action-btn {
    padding: 1rem;
    text-align: center;
    border-radius: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--secondary-color);
    background: linear-gradient(135deg, #fffdf8 0%, #f7f0e1 100%);
    border: 1px solid rgba(201, 163, 74, 0.2);
    box-shadow: 0 8px 18px rgba(23, 60, 53, 0.06);
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, rgba(201, 163, 74, 0.12), rgba(23, 60, 53, 0.04));
    transform: translateY(-3px);
    color: var(--secondary-color);
    box-shadow: 0 12px 22px rgba(23, 60, 53, 0.12);
}

.quick-action-btn i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* DataTable Customization */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

/* Footer */
.footer {
    border-top: 1px solid rgba(201, 163, 74, 0.25);
    background: linear-gradient(135deg, #173c35 0%, #0f2a25 100%);
    color: #fff;
}

.footer .text-muted,
.footer span {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Customer Profile */
.profile-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-soft) 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
