/* CSS Variables for Theming */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #111;
    --bg-tertiary: #1a1a1a;
    --bg-quaternary: #1c1c1c;
    
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    
    --border-color: #222;
    --border-light: #333;
    
    --primary-color: #007bff;
    --success-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #f5c400;
    --info-color: #9e9e9e;
    
    --shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    --shadow-light: 0 0 20px rgba(0, 0, 0, 0.6);
    --shadow-modal: 0 0 30px rgba(0, 0, 0, 0.6);
    
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --radius-2xl: 16px;
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

/* Prevent modal body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.container {
    width: 360px;
    background: var(--bg-secondary);
    padding: 40px 30px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
    text-align: center;
    color: var(--text-primary);
}

.logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 25px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo::before,
.logo::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    inset: 0;
    border: 2px solid rgba(255,255,255,0.12);
}

.logo::after {
    inset: -6px;
    border-color: rgba(255,255,255,0.18);
}

.logo svg {
    width: 58px;
    height: 58px;
}

h2 {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.subtext {
    font-size: 13px;
    margin-bottom: 25px;
    color: var(--text-secondary);
}

.subtext a {
    color: var(--primary-color);
    text-decoration: none;
}

.subtext a:hover {
    text-decoration: underline;
}

input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-quaternary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

input:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.password-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 12px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.btn {
    width: 100%;
    background: var(--primary-color);
    border: none;
    padding: 12px;
    font-size: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-top: 6px;
    font-weight: bold;
    color: white;
    transition: var(--transition);
}

.btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.or-text {
    margin: 18px 0;
    font-size: 12px;
    opacity: 0.6;
}

.socials {
    display: flex;
    justify-content: space-between;
}

.social-btn {
    width: 32%;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-btn:hover {
    background: var(--bg-quaternary);
}

.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.flash {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    color: white;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--border-color);
    animation: slideIn 0.2s ease;
    word-wrap: break-word;
}

.flash-success {
    border-left: 3px solid var(--success-color);
}

.flash-error {
    border-left: 3px solid var(--danger-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Compact Search Box */
.search-box-compact {
    margin-bottom: 20px;
}

.search-input-compact {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-input-compact:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.search-input-compact::placeholder {
    color: var(--text-tertiary);
}

/* Remove old search styles */
.search-box {
    display: none;
}

.search-form {
    display: none;
}

/* Top nav buttons */
.nav-actions .btn {
    width: auto;
    padding: 10px 14px;
    margin: 0;
}

.btn.danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: transparent;
    border: 1px solid var(--danger-color);
}

.btn.danger:hover {
    background: var(--danger-color);
    color: #fff;
}

/* Image-only product grid */
.products-grid.image-only {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.product-card.image-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card.image-card .product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 100%);
    color: #fff;
    font-weight: 600;
    transition: var(--transition);
}

.product-card.image-card:hover .product-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,123,255,0.9) 100%);
}

/* Modal */
.modal.hidden { 
    display: none; 
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    margin: 60px auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 20px;
    z-index: 2100;
    box-shadow: var(--shadow-modal);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-left img {
    width: 100%;
    border-radius: var(--radius-lg);
    object-fit: cover;
    max-height: 420px;
}

.modal-right h2 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-description {
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    margin-bottom: 15px;
}

.modal-options {
    margin: 20px 0;
}

.options-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 15px;
}

.options-select {
    position: relative;
}

.options-select-main {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.options-select-main:hover {
    border-color: var(--border-light);
}

.options-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: #151515;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    max-height: 220px;
    overflow-y: auto;
    z-index: 2200;
}

.options-dropdown.hidden {
    display: none;
}

.option-row-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: var(--transition);
}

.option-row-btn:hover {
    background: var(--border-color);
}

.quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0;
    color: var(--text-primary);
    font-size: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity-control button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-quaternary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
}

.quantity-control button:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
}

.quantity-control input {
    width: 70px;
    margin: 0;
    text-align: center;
}

.modal-actions .block { 
    width: 100%; 
    margin-top: 6px; 
}

/* Options builder */
.options-builder {
    margin: 12px 0 20px 0;
    background: #171717;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.option-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 50px;
    gap: 8px;
    margin-bottom: 8px;
}

.option-row input { 
    margin-bottom: 0; 
}

.option-row .remove-option {
    background: #2a2a2a;
    border: 1px solid var(--border-light);
    color: var(--danger-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.option-row .remove-option:hover {
    background: var(--danger-color);
    color: white;
}

/* Cart */
.cart-empty, .cart-summary, .cart-list, .cart-header-row {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.cart-empty-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-empty-body {
    text-align: center;
    padding: 40px 0 20px 0;
    color: rgba(255,255,255,0.8);
}

.cart-empty-body p {
    margin-bottom: 16px;
}

.cart-empty-body .btn {
    margin-top: 4px;
}

.cart-list { 
    margin-top: 14px; 
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 140px;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.cart-item:last-child { 
    border-bottom: none; 
}

.cart-item-left img {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
}

.cart-placeholder {
    width: 100px;
    height: 80px;
    background: var(--bg-quaternary);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-tertiary);
    border-radius: var(--radius-md);
    font-size: 12px;
}

.cart-item-title { 
    color: var(--text-primary); 
    font-weight: 600; 
}

.cart-item-option { 
    color: var(--text-secondary); 
    font-size: 13px; 
}

.cart-item-qty { 
    color: var(--text-primary); 
}

.cart-item-price { 
    text-align: right; 
}

.cart-item-price,
.cart-item-price span,
.summary-line span,
.dashboard-main,
.cart-header-row h2 {
    color: var(--text-primary);
}

.cart-summary { 
    margin-top: 14px; 
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.summary-line.total-line {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 16px;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
    gap: 20px;
}

.cart-main-column { 
    min-width: 0; 
}

.cart-sidebar {
    align-self: flex-start;
    position: sticky;
    top: 20px;
}

.checkout-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    color: var(--text-primary);
}

.checkout-card h3 {
    margin-bottom: 12px;
}

.checkout-section-title {
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(255,255,255,0.9);
}

.checkout-radio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.95);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.checkout-radio:hover:not(.disabled) {
    background: var(--border-color);
    border-color: var(--border-light);
}

.checkout-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.checkout-radio.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.checkout-radio.disabled input {
    cursor: not-allowed;
}

.coupon-row {
    display: grid;
    grid-template-columns: 1.5fr auto;
    gap: 8px;
    margin-top: 16px;
}

.coupon-row input {
    margin-bottom: 0;
}

/* Payment method simplification */
.payment-simple-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.payment-simple-btn:hover {
    background: var(--border-color);
    border-color: var(--primary-color);
}

.payment-icon {
    font-size: 20px;
}

/* Orders */
.orders-controls {
    margin-bottom: 20px;
}

.filter-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-group label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin-right: 5px;
}

.filter-btn {
    padding: 6px 12px;
    background: var(--border-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
}

.page-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.orders-table th, .orders-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

.orders-table th {
    background: var(--border-color);
    text-align: left;
    color: var(--text-primary);
}

.orders-table td {
    color: rgba(255, 255, 255, 0.9);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-pending { background: var(--warning-color); }
.status-finished { background: var(--success-color); }
.status-failed { background: var(--danger-color); }
.status-partial { background: #ff9800; }
.status-refunded { background: var(--info-color); }

/* Tabs */
.tab-actions { 
    display: flex; 
    gap: 8px; 
    margin-top: 6px; 
}

.tab-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.tab-btn:hover {
    background: var(--border-color);
}

.tab-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Account/Profile */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.info-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.info-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

.balance-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--success-color);
    margin: 8px 0;
}

.summary-note {
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Dashboard Styles */
.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    background: var(--bg-primary);
}

.dashboard-header {
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-radius: var(--radius-2xl);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-content.space-between {
    align-items: flex-start;
}

.header-content h1 {
    margin: 0;
    font-size: 28px;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.dashboard-main {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
}

.dashboard-main.account-main {
    padding: 30px;
}

.section-title {
    color: var(--text-primary);
    font-size: 24px;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.3);
}

.product-image {
    width: 100%;
    height: 200px;
    background: var(--bg-quaternary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image.no-image {
    color: var(--text-tertiary);
    font-size: 14px;
}

.product-info {
    padding: 20px;
}

.product-name {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.product-price {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
}

.stock-available {
    color: var(--success-color);
    font-size: 13px;
}

.stock-unavailable {
    color: var(--danger-color);
    font-size: 13px;
}

.purchase-form {
    margin-top: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.quantity-selector label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    margin: 0;
}

.btn-block {
    width: 100%;
}

.btn.block {
    width: 100%;
}

.btn-disabled {
    background: var(--border-light);
    color: #666;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Admin Panel Styles */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 25px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* User Management Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.badge-admin {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-banned {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Inline Forms */
.inline-form {
    display: inline-block;
    margin: 0 2px;
}

/* Actions Cell */
.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn {
    margin: 2px;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.scroll-to-top:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

/* Better Modal Close Button */
.modal-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: rotate(90deg);
}

/* Improved Table Responsiveness */
@media (max-width: 1024px) {
    .admin-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 800px;
    }
}

/* Better Button States */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Better Focus States for Accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved Placeholder Styles */
::placeholder {
    color: var(--text-tertiary);
    opacity: 1;
}

/* Better Select Boxes */
select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-quaternary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
}

select:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Image Error Placeholder */
.img-error-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-quaternary);
    color: var(--text-tertiary);
    font-size: 12px;
    width: 100%;
    height: 100%;
}

/* Better Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Improved Hover Effects */
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.3);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Better Transitions */
* {
    transition: background-color 0.2s ease, 
                border-color 0.2s ease,
                color 0.2s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease,
                opacity 0.2s ease;
}

/* Remove transitions from specific elements */
input, textarea, select {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Print Styles */
@media print {
    .no-print,
    .header-actions,
    .btn,
    button,
    .flash-messages {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .dashboard-main,
    .container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --bg-primary: #000;
        --bg-secondary: #1a1a1a;
        --text-primary: #fff;
        --border-color: #fff;
    }
}

/* Dark Mode Enhancements (for systems that prefer dark) */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but ensuring consistency */
    body {
        background: var(--bg-primary);
    }
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-quaternary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    color: var(--text-primary);
}

.modal-body p {
    margin: 0;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Modal Responsive Design */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Google OAuth Button Styling */
.google-btn {
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #c0c4cc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-btn svg {
    width: 18px;
    height: 18px;
}

/* Admin Panel Button Improvements */
.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.admin-actions .btn {
    font-size: 14px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    min-width: auto;
    white-space: nowrap;
}

.admin-actions .btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.admin-actions .btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.admin-actions .btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.admin-actions .btn-secondary:hover {
    background: var(--bg-quaternary);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Form Group and Textarea Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

/* Product Form Improvements */
.product-form .form-group {
    margin: 20px 0;
}

.product-form input[type="text"],
.product-form input[type="number"],
.product-form textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
}

.product-form input:focus,
.product-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Profile Page Enhancements */
.balance-value {
    color: var(--success-color);
    font-weight: 600;
    font-size: 18px;
}

.profile-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.profile-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.profile-actions .btn i {
    font-size: 16px;
}

.profile-actions .btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.profile-actions .btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.profile-actions .btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.profile-actions .btn-secondary:hover {
    background: var(--bg-quaternary);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Topup Page Enhancements */
.topup-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 30px;
}

.topup-section h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 20px;
}

.topup-section p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.payment-options {
    margin-bottom: 25px;
}

.payment-option {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option.active {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.1);
}

.payment-option:hover {
    border-color: var(--border-light);
}

.option-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-icon {
    font-size: 24px;
    color: var(--text-primary);
}

.option-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
}

.option-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 2px;
}

.topup-form .form-group {
    margin-bottom: 20px;
}

.topup-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.topup-form input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
}

.topup-form input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.topup-form small {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Admin Panel Image Fixes */
.admin-table img {
    max-width: 60px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.admin-table .product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
}

/* Product Click Area Fix */
.product-card {
    cursor: pointer;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-card .btn {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
}

/* Admin Orders Table Fix */
.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.admin-table tr:hover {
    background: var(--bg-tertiary);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-finished { background: var(--success-color); }
.status-pending { background: var(--warning-color); }
.status-failed { background: var(--danger-color); }
.status-processing { background: var(--primary-color); }

/* Admin Edit Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
}

.edit-form .form-group {
    margin-bottom: 20px;
}

.edit-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.edit-form input[type="text"],
.edit-form input[type="email"],
.edit-form input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.edit-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.edit-form input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.edit-form .form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.edit-form .btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.edit-form .btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}

.edit-form .btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.edit-form .btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.edit-form .btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}
