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

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #161d30;
    --bg-glass: rgba(22, 29, 48, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-glow: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism containers */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Header & Navbar */
header {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--accent-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.btn-primary {
    background: var(--accent-glow);
    color: var(--text-primary) !important;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Main content wrapper */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Grid & Catalog */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.3);
}

.product-image {
    width: 100%;
    height: 200px;
    background: #1e294b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    color: var(--text-secondary);
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-category {
    font-size: 0.85rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stock-tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stock-out {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Auth Cards */
.auth-wrapper {
    max-width: 450px;
    margin: 4rem auto;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 0.5rem;
    background: var(--accent-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-top: 1rem;
}

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

th, td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* 3D Rotating Credit Card UI */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
}

.card-scene {
    width: 100%;
    max-width: 380px;
    height: 220px;
    perspective: 1000px;
    margin: 0 auto 2rem;
}

.credit-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.credit-card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-front {
    background: linear-gradient(135deg, #1e1b4b 0%, #311042 100%);
}

.card-back {
    background: linear-gradient(135deg, #311042 0%, #1e1b4b 100%);
    transform: rotateY(180deg);
}

.card-chip {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    border-radius: 5px;
}

.card-number {
    font-size: 1.3rem;
    letter-spacing: 3px;
    font-weight: 600;
    margin: 1.5rem 0;
}

.card-holder-row {
    display: flex;
    justify-content: space-between;
}

.card-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.card-val {
    font-size: 0.9rem;
    font-weight: 500;
}

.card-black-bar {
    width: 100%;
    height: 45px;
    background: #000;
    margin-left: -1.5rem;
    width: calc(100% + 3rem);
}

.card-signature-cvv {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.card-signature {
    flex: 1;
    height: 35px;
    background: #e2e8f0;
    border-radius: 4px;
}

.card-cvv-box {
    background: #fff;
    color: #000;
    padding: 0.3rem 0.7rem;
    font-weight: 600;
    border-radius: 4px;
}

/* POS Panel */
.pos-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .pos-wrapper {
        grid-template-columns: 1fr;
    }
}

.pos-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.pos-product-item {
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.pos-product-item:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.pos-cart {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    margin: 1.5rem 0;
    min-height: 200px;
}

.pos-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-glass);
}

.pos-total-row {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-glass);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    margin-top: auto;
}

/* ==========================================
   Responsive & Mobile Improvements
   ========================================== */

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-two-cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.catalog-filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.booking-upload-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    min-width: 280px;
}

/* Ensure buttons wrap text nicely without overlapping */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
    vertical-align: middle;
    white-space: normal; /* allow wrapping */
    word-break: keep-all;
}

@media (max-width: 992px) {
    .dashboard-two-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        position: relative;
    }

    .nav-container {
        padding: 1rem 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle {
        display: inline-flex;
        order: 2;
    }

    .logo {
        order: 1;
    }

    nav {
        order: 3;
        width: 0;
        height: 0;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: rgba(11, 15, 25, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-glass);
        padding: 1.5rem;
        gap: 1rem;
        align-items: stretch;
        z-index: 999;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 0.8rem 1.2rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-glass);
    }

    .nav-menu a:hover {
        background: rgba(139, 92, 246, 0.15);
        border-color: var(--accent-purple);
    }

    .user-info {
        padding: 0.8rem 1.2rem;
        border-top: 1px solid var(--border-glass);
        border-bottom: 1px solid var(--border-glass);
        margin: 0.5rem 0;
        background: rgba(255, 255, 255, 0.01);
        border-radius: 8px;
    }

    main {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    .catalog-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-filter-form > div,
    .catalog-filter-form > button,
    .catalog-filter-form > a {
        width: 100% !important;
        flex: none !important;
        text-align: center;
    }

    th, td {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .booking-upload-form {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        min-width: 150px;
    }
    .booking-upload-form .form-control {
        width: 100%;
    }
    .booking-upload-form .btn-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card-scene {
        transform: scale(0.8);
        transform-origin: center top;
        margin-bottom: -2rem; /* adjust layout due to scaling */
    }

    .checkout-container {
        gap: 1rem;
    }

    .glass-panel {
        padding: 1.25rem !important;
    }

    h1 {
        font-size: 1.7rem !important;
    }
}
