@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --gold: #d4af37;
    --gold-light: #fef08a;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
}

* {
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
}

/* AUTH PAGE */
#auth-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #000000);
    padding: 20px;
    color: white;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.auth-logo {
    font-size: 50px;
    color: var(--gold);
    margin-bottom: 10px;
}

.auth-title {
    font-size: 32px;
    font-weight: 900;
    margin: 0 0 5px 0;
    letter-spacing: -0.5px;
}

.auth-sub {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 30px;
}

.input-wrap {
    position: relative;
    margin-bottom: 15px;
}

.input-wrap i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
}

.input-wrap input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.input-wrap input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--gold), #b38f22);
    color: var(--primary);
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
    transition: 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* APP HEADER */
header {
    background: var(--surface);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--gold);
}

.header-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-btn {
    background: linear-gradient(135deg, var(--gold), #b38f22);
    color: var(--primary);
    border: none;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.25);
    position: relative;
    transition: 0.2s;
}

.cart-btn:active {
    transform: scale(0.95);
}

.cart-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 10px;
    display: none;
}

.logout-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
}

/* DASHBOARD */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    padding: 20px;
    padding-bottom: 80px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--primary);
}

/* DESIGN GRID */
.design-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.design-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
}

.design-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e2e8f0;
    cursor: pointer;
}

.design-info {
    padding: 12px;
    text-align: center;
}

.d-num {
    font-size: 15px;
    font-weight: 900;
    color: var(--primary);
}

.d-name {
    font-size: 12px;
    color: var(--text-sub);
    margin: 4px 0 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-btn {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.order-btn:active {
    background: #1da851;
    transform: scale(0.95);
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    overflow: hidden;
    animation: popIn 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background: #eee;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.modal-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    margin: 0 0 5px 0;
}

.modal-sub {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 20px;
}

.size-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 12px;
    font-weight: 700;
}

.size-lbl {
    font-size: 16px;
    color: var(--primary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.status-badge.avail {
    background: #dcfce7;
    color: var(--success);
}

.status-badge.out {
    background: #fee2e2;
    color: var(--danger);
}

/* LOADING */
#loader {
    text-align: center;
    padding: 40px;
    color: var(--text-sub);
    font-weight: 600;
}

/* SIZE STEPPER IN MODAL */
.size-row {
    border: 1px solid transparent;
    transition: 0.2s;
}

.size-row.avail-row:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.size-lbl-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 10px;
}

.qty-stepper.disabled {
    background: transparent;
    padding: 4px 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: var(--surface);
    color: var(--primary);
    font-weight: 900;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: 0.15s;
}

.qty-btn:active {
    background: var(--gold);
    color: white;
    transform: scale(0.9);
}

.qty-val {
    min-width: 20px;
    text-align: center;
    font-weight: 900;
    font-size: 15px;
    color: var(--primary);
}

/* CART MODAL */
.cart-content {
    max-width: 500px;
    max-height: 85vh;
}

.cart-header {
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.cart-body {
    padding: 15px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.cart-footer {
    padding: 15px 20px 20px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.cart-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-sub);
}

.cart-item-card {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    position: relative;
}

.cart-item-img {
    width: 70px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    background: #eee;
    cursor: pointer;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.remove-btn {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: 0.15s;
}

.remove-btn:hover {
    background: var(--danger);
    color: white;
}

.cart-sizes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.cart-size-chip {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-chip-btns {
    display: flex;
    gap: 2px;
}

.cart-chip-btns button {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cart-item-total {
    font-size: 13px;
    font-weight: 800;
    color: var(--gold);
    align-self: flex-end;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 1px solid var(--gold);
    font-weight: 700;
    font-size: 15px;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}
