@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ========================================
   GALAK STORE — Global Design System
   ======================================== */

:root {
    --bg: #0a0a0a;
    --bg-secondary: #0e0e0e;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --bg-input: #0d0d0d;
    --border: #1a1a1a;
    --border-hover: #2a2a2a;
    --border-focus: #333333;
    --text: #ffffff;
    --text-dim: #888888;
    --text-muted: #555555;
    --text-dark: #333333;
    --glow: rgba(255, 255, 255, 0.06);
    --glow-strong: rgba(255, 255, 255, 0.12);
    --accent: #ffffff;
    --success: #4ade80;
    --success-bg: #0a1f0a;
    --success-border: #1a3a1a;
    --error: #f87171;
    --error-bg: #1f0a0a;
    --error-border: #3a1a1a;
    --warning: #fbbf24;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(255,255,255,0.02);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', 'Helvetica', 'Inter', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* === NOISE OVERLAY === */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* === AMBIENT GLOW === */
.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ambient-glow.top { top: -300px; left: 50%; transform: translateX(-50%); }
.ambient-glow.bottom { bottom: -400px; right: -200px; }

/* === PARTICLES === */
.particle-field {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    animation: drift linear infinite;
}

@keyframes drift {
    from { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    to { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* === NAV === */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.15));
}

.nav-brand span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s, text-shadow 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--text);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text);
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.nav-links a:hover::after { width: 100%; }

.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after { width: 100%; }

/* === GLOW LINE === */
.glow-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

/* === NOTIFICATION BELL === */
.notif-bell-wrap {
    position: relative;
    margin-left: 16px;
}

.notif-bell {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dim);
    transition: var(--transition);
    position: relative;
}

.notif-bell:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.03);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #e53e3e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
    animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(229, 62, 62, 0.5); }
    50% { box-shadow: 0 0 20px rgba(229, 62, 62, 0.8), 0 0 40px rgba(229, 62, 62, 0.3); }
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 2000;
    overflow: hidden;
}

.notif-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-dropdown-header {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

.notif-dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover {
    background: rgba(255,255,255,0.02);
}

.notif-item-new {
    background: rgba(229, 62, 62, 0.05);
    border-left: 3px solid #e53e3e;
}

.notif-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.notif-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.notif-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}

.notif-pending {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
}

.notif-approved {
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
}

.notif-rejected {
    color: var(--error);
    background: rgba(248, 113, 113, 0.1);
}

.notif-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-code {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.notif-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.notif-item-view {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.notif-item:hover .notif-item-view {
    color: var(--text);
}

/* === RECEIPT OVERLAY === */
.receipt-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.receipt-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.receipt-card {
    position: relative;
    width: 90%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    padding: 32px;
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.03),
        0 24px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.95) translateY(12px);
    transition: transform 0.3s ease;
}

.receipt-overlay.open .receipt-card {
    transform: scale(1) translateY(0);
}

.receipt-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.receipt-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: var(--border-hover);
}

.receipt-header {
    text-align: center;
    margin-bottom: 8px;
}

.receipt-header .receipt-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.receipt-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}

.receipt-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 6px;
}

.receipt-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.receipt-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.receipt-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.receipt-fields.receipt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.receipt-field {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}

.receipt-field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.receipt-field-value {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    word-break: break-word;
}

.receipt-admin-note {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 8px;
    padding: 14px;
}

.receipt-admin-note .receipt-note-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--warning);
}

.receipt-admin-note p {
    font-size: 13px;
    color: var(--text-dim);
    margin: 8px 0 0;
    line-height: 1.5;
}

/* Receipt scrollbar */
.receipt-card::-webkit-scrollbar { width: 4px; }
.receipt-card::-webkit-scrollbar-track { background: transparent; }
.receipt-card::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

@media (max-width: 500px) {
    .receipt-card { padding: 20px; }
    .receipt-fields.receipt-grid { grid-template-columns: 1fr; }
}

/* === NOTIF GUIDE TOOLTIP === */
.notif-guide {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.5));
}

.notif-guide.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.notif-guide-arrow {
    position: absolute;
    top: -7px;
    right: 14px;
    width: 14px;
    height: 14px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-hover);
    border-left: 1px solid var(--border-hover);
    transform: rotate(45deg);
    z-index: 1;
}

.notif-guide-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 14px;
    padding: 20px 22px;
    width: 300px;
    text-align: center;
}

.notif-guide-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
    animation: notifGuideBounce 1.5s ease infinite;
}

@keyframes notifGuideBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.notif-guide-content p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 0 14px;
}

.notif-guide-content p strong {
    color: var(--text);
}

.notif-guide-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.notif-guide-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Bell pulse animation when guide is showing */
.notif-bell-pulse {
    animation: bellPulseAnim 1.2s ease infinite;
}

@keyframes bellPulseAnim {
    0% { transform: scale(1); }
    15% { transform: scale(1.15) rotate(8deg); }
    30% { transform: scale(1.15) rotate(-8deg); }
    45% { transform: scale(1.15) rotate(5deg); }
    60% { transform: scale(1.05) rotate(-3deg); }
    75% { transform: scale(1); }
    100% { transform: scale(1); }
}

@media (max-width: 400px) {
    .notif-guide-content { width: 260px; }
    .notif-guide { right: -8px; }
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(255,255,255,0.15), 0 10px 40px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.03);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    padding: 8px 16px;
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.btn-danger {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.1);
}

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.btn-full { width: 100%; }

.btn:active { transform: translateY(0); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* === FORMS === */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.form-group label .required {
    color: #666;
    margin-left: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.03), 0 0 20px rgba(255,255,255,0.03);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.form-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    letter-spacing: -0.3px;
}

.form-error {
    color: var(--error);
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: var(--error-border);
}

.form-group.error .form-error {
    display: block;
}

/* === TOAST === */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.toast.show { transform: translateX(0); }

.toast.toast-success { border-color: var(--success-border); }
.toast.toast-error { border-color: var(--error-border); }

.toast-icon { font-size: 18px; flex-shrink: 0; }

/* === SCROLL REVEAL === */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === LOADING SPINNER === */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* === BADGE === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-approved {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-rejected {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

.badge-new {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--border);
}

.footer img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
    margin-bottom: 16px;
}

.footer p {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 1px;
}

.footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s;
}

.footer-links a:hover { color: var(--text); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav { padding: 16px 20px; }
    .nav-links { gap: 20px; }
    .nav-links a { font-size: 12px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .nav-links { display: none; }
}
