/* ============================================
   myShopStyles.css - Main Stylesheet for myShop App
   Version: 1.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c8ff5;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #fc8181;
    --info: #4299e1;
    
    --bg-dark: #0f0c29;
    --bg-card: #1a1a2e;
    --bg-card-hover: #16213e;
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.03);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.6);
    
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 70px;
    line-height: 1.6;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

.container-fluid {
    padding: 0 24px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5,
.card-header h6 {
    margin: 0;
    font-weight: 600;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #38a169;
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
    color: white;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
    color: white;
    transform: translateY(-2px);
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #3182ce;
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-control-sm {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.form-control-lg {
    padding: 16px 20px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}

select.form-control {
    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='rgba(255,255,255,0.4)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead th {
    padding: 12px 16px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-info {
    background: var(--info);
    color: white;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border-color: rgba(72, 187, 120, 0.2);
    color: #68d391;
}

.alert-danger {
    background: rgba(252, 129, 129, 0.1);
    border-color: rgba(252, 129, 129, 0.2);
    color: #fc8181;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    border-color: rgba(237, 137, 54, 0.2);
    color: #ed8936;
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    border-color: rgba(66, 153, 225, 0.2);
    color: #63b3ed;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card .stat-icon.primary {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: rgba(237, 137, 54, 0.15);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: rgba(252, 129, 129, 0.15);
    color: var(--danger);
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.toast-body {
    color: var(--text-secondary);
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-header .modal-title {
    color: var(--text-primary);
    font-weight: 700;
}

.modal-header .btn-close {
    filter: invert(1) brightness(200%);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.border { border: 1px solid var(--border-color); }
.hidden { display: none !important; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   PAGE VERSION FOOTER
   ============================================ */
.page-version {
    text-align: center;
    padding: 20px 0 10px 0;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.page-version .badge-version {
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 2px 12px;
    border-radius: 10px;
    font-weight: 600;
}

.page-version .refresh-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.page-version .refresh-link:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    body { padding-top: 60px; }
    .container-fluid { padding: 0 16px; }
    .card { padding: 16px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-number { font-size: 22px; }
}

@media (max-width: 480px) {
    .container-fluid { padding: 0 12px; }
    .card { padding: 12px; border-radius: 10px; }
    .btn { padding: 8px 14px; font-size: 13px; }
    .table { font-size: 13px; }
    .table thead th,
    .table tbody td { padding: 8px 12px; }
}

/* Fix for quantity input text color */
.cart-table .quantity-input input {
    width: 50px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: #ffffff !important; /* Force white text */
    padding: 6px 4px;
}

.cart-table .quantity-input input:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

/* Fix for price and total text */
.cart-table .table tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff !important;
}

.cart-table .product-info .product-name {
    font-weight: 600;
    margin-bottom: 2px;
    color: #ffffff !important;
}

.cart-table .product-info .product-variant {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Fix for quantity buttons */
.cart-table .quantity-input button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: #ffffff !important;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-table .quantity-input button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Summary text colors */
.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    color: #ffffff !important;
}

.cart-summary .summary-row.total {
    font-size: 20px;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
    color: #ffffff !important;
}


/* ============================================
   CART TEXT VISIBILITY FIX
   ============================================ */
.cart-table .table tbody td,
.cart-table .product-info .product-name,
.cart-table .product-info .product-variant,
.cart-table .quantity-input input,
.cart-table .quantity-input button,
.cart-summary .summary-row,
.cart-summary .summary-row span,
.cart-summary .summary-row.total span,
.cart-summary h5,
.item-price,
.item-total {
    color: #ffffff !important;
}

.cart-table .quantity-input input {
    background: rgba(255, 255, 255, 0.1) !important;
}
