@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0b0c10;
    --bg-card: rgba(22, 24, 34, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8f9fa;
    --text-muted: #a9b7c6;
    --accent: #66fcf1;
    --accent-hover: #45f3ff;
    --danger: #e63946;
    --warning: #fca311;
    --success: #00b4d8;
    --font-main: 'Outfit', sans-serif;
    --transition-speed: 0.4s;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   Page Transitions
   ========================================================================== */
.page-transition-wrapper {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-speed) cubic-bezier(0.25, 1, 0.5, 1),
                transform var(--transition-speed) cubic-bezier(0.25, 1, 0.5, 1);
}

.page-transition-wrapper.page-fade-in {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-wrapper.page-fade-out {
    opacity: 0;
    transform: translateY(-15px);
}

/* ==========================================================================
   Splash Screen Gate
   ========================================================================== */
.splash-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1f4068 0%, #0b0c10 70%);
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 252, 241, 0.2) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: aurora-float 12s infinite alternate ease-in-out;
}

.aurora-1 { top: -100px; left: -100px; }
.aurora-2 { bottom: -150px; right: -100px; background: radial-gradient(circle, rgba(0, 180, 216, 0.15) 0%, rgba(0,0,0,0) 70%); }

@keyframes aurora-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.2); }
}

.splash-content {
    z-index: 2;
    text-align: center;
    backdrop-filter: blur(10px);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 90%;
}

.splash-logo-glow {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #00b4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(102, 252, 241, 0.3);
    margin-bottom: 12px;
}

.splash-loader {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    background-size: 200% 100%;
    animation: loader-slide 1.5s infinite linear;
    margin: 24px auto;
    border-radius: 10px;
}

@keyframes loader-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Public Homepage (Landing Page)
   ========================================================================== */
.landing-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 5%;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 5%;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Grid & Glassmorphism Cards */
.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    width: 90%;
    max-width: 1200px;
    margin: 50px auto;
}

.premium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}

.premium-card:hover {
    transform: translateY(-8px);
    border-color: rgba(102, 252, 241, 0.3);
}

.premium-card h3 {
    color: var(--accent);
    margin-bottom: 12px;
}

.premium-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-family: var(--font-main);
    cursor: pointer;
    transition: 0.3s ease;
    border: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00b4d8);
    color: #0b0c10;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 252, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ==========================================================================
   Modern Login Page (Frosted Glass)
   ========================================================================== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at bottom right, #00b4d8 0%, #0b0c10 60%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

/* ==========================================================================
   Forms with Floating Labels
   ========================================================================== */
.premium-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-control {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
    outline: none;
}

/* Fix untuk dropdown agar teks terlihat di semua browser */
select.form-control option {
    background-color: #161822; /* Warna solid sesuai bg-card */
    color: var(--text-primary);
    padding: 10px;
    border: none;
}

/* Penyesuaian padding jika ada ikon */
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    z-index: 5;
    pointer-events: none;
}

.input-icon + .form-control {
    padding-left: 48px;
}

.input-icon + .form-control + .floating-label {
    left: 48px;
}

.form-control:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
}

/* CSS Floating Label Logic */
.floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: 0.2s ease all;
    pointer-events: none;
}

/* Float active label when input has placeholder shown (which is space) or focus */
.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
    top: -8px;
    left: 10px;
    font-size: 0.8rem;
    color: var(--accent);
    background-color: #161822; /* Sesuai warna background card */
    padding: 2px 8px;
    border-radius: 4px;
}

/* Error feedback styling */
.form-group.has-error .form-control {
    border-color: var(--danger);
}

.form-group.has-error .floating-label {
    color: var(--danger);
}

.form-error-feedback {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Select element overrides */
.select-wrapper {
    position: relative;
}

.select-control {
    appearance: auto; /* Kembalikan ke auto agar arrow bawaan terlihat jika tidak pakai ikon kustom */
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), 
                      linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.select-label {
    top: 50%;
}

.select-control:focus ~ .select-label,
.select-control:valid ~ .select-label {
    top: -8px;
    left: 10px;
    font-size: 0.8rem;
    color: var(--accent);
    background-color: #121420;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ==========================================================================
   Admin Shell / Dashboard Layout
   ========================================================================== */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(22, 24, 34, 0.95);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    transition: left 0.3s ease;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s ease;
}

.sidebar-link i {
    font-size: 1.1rem;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(102, 252, 241, 0.1);
    color: var(--accent);
}

.main-content {
    flex: 1;
    padding: 40px 5%;
    overflow-y: auto;
    background: radial-gradient(circle at top right, #13141f 0%, #0b0c10 80%);
    width: 100%;
}

.premium-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 20px;
    gap: 20px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
}

/* ==========================================================================
   Table & Datatables Styling
   ========================================================================== */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
}

.table-header-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    width: 280px;
}

.table-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s ease;
}

.table-search-input:focus {
    border-color: var(--accent);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.premium-table th {
    padding: 16px;
    border-bottom: 2px solid var(--border-glass);
    color: var(--accent);
    font-weight: 600;
}

.premium-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.premium-table tbody tr {
    transition: background-color 0.2s ease;
}

.premium-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.empty-table-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-left: 4px;
}

/* Action Button in Tables */
.table-action-cell {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
    min-width: 180px;
}

.btn-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: 0.2s ease;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    font-size: 0.8rem;
    gap: 8px;
}

.btn-table-edit:hover {
    background: var(--accent);
    color: #0b0c10;
}

.btn-table-delete:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn-table-view:hover {
    background: var(--success);
    color: #ffffff;
}

.btn-table-pay:hover {
    background: var(--warning);
    color: #0b0c10;
}

/* Pagination Footer */
.table-footer-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-page:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-page:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.1);
}

.page-numbers-wrapper {
    display: flex;
    gap: 6px;
}

.btn-page-num {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.btn-page-num.active {
    background: var(--accent);
    color: #0b0c10;
    font-weight: bold;
}

.btn-page-num:not(.active):hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.premium-modal {
    background: #121420;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: modal-zoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes modal-zoom {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.premium-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.premium-modal-header h3 {
    margin: 0;
    color: var(--accent);
}

.modal-close-x {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.modal-close-x:hover {
    color: var(--danger);
}

.premium-modal-body {
    padding: 24px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.premium-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--border-glass);
}

/* ==========================================================================
   Responsive Media Queries (Mobile First Fix)
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .admin-shell {
        flex-direction: column;
    }

    .main-content {
        padding: 80px 20px 40px 20px; /* Space for mobile toggle */
    }

    .premium-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-toggle {
        display: flex !important;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--accent);
        color: var(--bg-dark);
        width: 45px;
        height: 45px;
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(102, 252, 241, 0.3);
    }

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

/* Overlay when sidebar active */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}
