/* ============================================
   CabPlanner Creator Partner Program
   Custom Styles (supplements Tailwind CSS)
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --navy: #09225c;
    --sky: #00b0ff;
    --sky-light: #e0f4ff;
    --sky-dark: #0091d5;
    --bg: #f8fafc;
    --white: #ffffff;
    --green: #10b981;
    --amber: #f59e0b;
    --red: #ef4444;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sky); }

/* ---------- Hero Section (Landing) ---------- */
.hero-section {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, #0d3a8c 40%, var(--sky) 100%);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 176, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(0, 176, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Floating shapes animation */
.hero-float-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: heroFloat 8s ease-in-out infinite;
    pointer-events: none;
}
.hero-float-shape:nth-child(1) { width: 300px; height: 300px; top: 10%; left: -5%; animation-delay: 0s; background: var(--sky); }
.hero-float-shape:nth-child(2) { width: 200px; height: 200px; top: 60%; right: -3%; animation-delay: 2s; background: #fff; }
.hero-float-shape:nth-child(3) { width: 150px; height: 150px; bottom: 10%; left: 30%; animation-delay: 4s; background: var(--sky); }

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* ---------- Glass Card ---------- */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

/* ---------- Stat Cards ---------- */
.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--navy), var(--sky));
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(9, 34, 92, 0.1);
    border-color: var(--sky);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.stat-icon.blue { background: rgba(0, 176, 255, 0.12); color: var(--sky); }
.stat-icon.navy { background: rgba(9, 34, 92, 0.1); color: var(--navy); }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.12); color: var(--amber); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.1;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
    font-weight: 500;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    z-index: 40;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-logo img {
    height: 34px;
    width: auto;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}
.nav-link:hover {
    background: var(--sky-light);
    color: var(--navy);
}
.nav-link.active {
    background: linear-gradient(135deg, var(--navy), #0d3a8c);
    color: #fff;
    box-shadow: 0 4px 12px rgba(9, 34, 92, 0.25);
}
.nav-link.active svg { color: #fff; opacity: 1; }
.nav-link svg { width: 20px; height: 20px; opacity: 0.7; flex-shrink: 0; }

.sidebar-profile {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--navy), var(--sky));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-profile-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ---------- Top Header (authenticated pages) ---------- */
.top-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}
.top-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 50;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--navy);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ---------- Main Content Area ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
}
.main-content-inner {
    padding: 32px;
    max-width: 1200px;
}

/* ---------- Content Cards ---------- */
.content-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    padding: 28px;
    transition: box-shadow 0.3s;
}
.content-card:hover {
    box-shadow: 0 4px 24px rgba(9, 34, 92, 0.06);
}

/* ---------- Table ---------- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}
.data-table tbody tr {
    transition: background 0.15s;
}
.data-table tbody tr:hover {
    background: var(--gray-100);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 4px;
}
.badge.saas { background: rgba(0, 176, 255, 0.12); color: #0284c7; }
.badge.package { background: rgba(16, 185, 129, 0.12); color: #059669; }
.badge.cleared { background: rgba(16, 185, 129, 0.12); color: #059669; }
.badge.pending { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge.withdrawn { background: rgba(9, 34, 92, 0.1); color: var(--navy); }

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--navy), #0d3a8c);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(9, 34, 92, 0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-sky {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--sky), var(--sky-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}
.btn-sky:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 176, 255, 0.35);
}
.btn-sky:active { transform: translateY(0); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}
.btn-outline:hover {
    border-color: var(--sky);
    background: var(--sky-light);
    color: var(--sky-dark);
}

/* ---------- Copy Link Input ---------- */
.copy-link-group {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-100);
    transition: border-color 0.2s;
}
.copy-link-group:focus-within {
    border-color: var(--sky);
}
.copy-link-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 16px;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    color: var(--navy);
    outline: none;
    min-width: 0;
}
.copy-link-group button {
    padding: 14px 20px;
    background: var(--navy);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}
.copy-link-group button:hover { background: #0d3a8c; }
.copy-link-group button.copied {
    background: var(--green);
}

/* ---------- Package Card ---------- */
.package-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(9, 34, 92, 0.1);
    border-color: var(--sky);
}
.package-card-img {
    height: 180px;
    background: linear-gradient(135deg, var(--navy), var(--sky));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.package-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(9, 34, 92, 0.3));
}
.package-card-body {
    padding: 20px;
}
.package-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.package-card-agent {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}
.package-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}
.package-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
}
.package-commission {
    font-size: 0.8rem;
    color: var(--green);
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 34, 92, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}
.modal-overlay.show {
    display: flex;
    opacity: 1;
}
.modal-box {
    background: var(--white);
    border-radius: 20px;
    padding: 32px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(9, 34, 92, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s;
}
.modal-overlay.show .modal-box {
    transform: scale(1);
}
.modal-close {
    float: right;
    background: var(--gray-100);
    border: none;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
    font-size: 1.1rem;
}
.modal-close:hover { background: var(--gray-200); color: var(--navy); }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(9, 34, 92, 0.3);
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ---------- Landing Page Sections ---------- */
.how-it-works-step {
    text-align: center;
    padding: 32px 24px;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}
.how-it-works-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(9, 34, 92, 0.08);
    border-color: var(--sky);
}
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--sky));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.benefit-card {
    padding: 28px;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--navy), var(--sky));
    opacity: 0;
    transition: opacity 0.3s;
}
.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(9, 34, 92, 0.08);
}
.benefit-card:hover::before { opacity: 1; }

/* ---------- Form ---------- */
.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    transition: border-color 0.2s;
    background: var(--white);
    outline: none;
}
.form-input:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(0, 176, 255, 0.12);
}
.form-input::placeholder { color: var(--gray-300); }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}

/* ---------- Search Input ---------- */
.search-input-group {
    position: relative;
}
.search-input-group svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-300);
}
.search-input-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    transition: border-color 0.2s;
    background: var(--white);
    outline: none;
}
.search-input-group input:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(0, 176, 255, 0.12);
}

/* ---------- Wallet Cards ---------- */
.wallet-big-card {
    background: linear-gradient(135deg, var(--navy) 0%, #0d3a8c 100%);
    color: #fff;
    border-radius: 20px;
    padding: 32px;
    position: relative;
    overflow: hidden;
}
.wallet-big-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(0, 176, 255, 0.15);
}
.wallet-big-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

/* ---------- Overlay for mobile sidebar ---------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 34, 92, 0.4);
    z-index: 35;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ---------- Animation Utils ---------- */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .top-header {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .hamburger {
        display: flex;
    }
}

@media (max-width: 768px) {
    .main-content-inner {
        padding: 20px 16px;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .content-card {
        padding: 20px;
    }
    .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .hero-section {
        min-height: auto;
        padding: 80px 0 60px;
    }
}

@media (max-width: 480px) {
    .main-content-inner {
        padding: 16px 12px;
    }
    .top-header {
        padding: 0 16px;
    }
}
