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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page.hidden {
    display: none;
}

/* Login Page */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-logo p {
    color: #94a3b8;
    font-size: 14px;
}

.login-form {
    width: 100%;
    max-width: 360px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Header */
.header {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    font-size: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Main */
.main {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    padding-bottom: 100px;
}

/* Category Nav */
.category-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    padding: 10px 20px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-item:hover {
    background: rgba(255,255,255,0.15);
}

.category-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
}

/* Products Section */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #fff;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.2);
}

.product-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.product-content {
    padding: 14px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.4;
}

.product-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.product-tag {
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    font-size: 10px;
    border-radius: 4px;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-current {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}



.price-original {
    font-size: 12px;
    color: #64748b;
    text-decoration: line-through;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}

.bottom-nav .nav-item:hover {
    color: #94a3b8;
}

.bottom-nav .nav-item.active {
    color: #3b82f6;
}

.bottom-nav .nav-icon {
    font-size: 24px;
}

.bottom-nav .nav-item span:last-child {
    font-size: 11px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    position: relative;
    background: #1e293b;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-modal .modal-content {
    max-height: 85vh;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Product Detail */
.product-detail {
    max-height: 85vh;
    overflow-y: auto;
}

.product-detail-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
}

.product-detail-content {
    padding: 24px;
}

.product-detail-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.product-detail-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 20px;
}

.product-detail-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
}

.product-detail-price .price-current {
    font-size: 28px;
}

.product-detail-price .price-original {
    font-size: 16px;
}

.product-detail-section {
    margin-bottom: 24px;
}

.product-detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-feature {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    font-size: 13px;
    border-radius: 8px;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    font-size: 15px;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    font-size: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: rgba(255,255,255,0.2);
}

.quantity-display {
    font-size: 18px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    animation: fadeInUp 0.4s ease-out forwards;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-product {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.order-status {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
}

.order-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.order-status.accepted {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.order-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.order-status.rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.order-info {
    display: grid;
    gap: 8px;
    font-size: 13px;
}

.order-info-item {
    display: flex;
    justify-content: space-between;
}

.order-info-label {
    color: #64748b;
}

.order-info-value {
    color: #e2e8f0;
}

.order-price {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-price-label {
    color: #64748b;
    font-size: 14px;
}

.order-price-value {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 15px;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive */
@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 14px;
}

.link-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.link-btn:hover {
    text-decoration: underline;
}

/* Payment Modal */
.payment-modal .modal-content {
    max-height: 95vh;
    overflow-y: auto;
}

.payment-container {
    padding: 24px;
}

.payment-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
}

.payment-qr-container {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.payment-qr-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.payment-amount {
    text-align: center;
    padding: 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.amount-label {
    display: block;
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.amount-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-upload-section {
    margin-bottom: 24px;
}

.payment-upload-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    text-align: center;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(59, 130, 246, 0.05);
}

.upload-area.hidden {
    display: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    color: #94a3b8;
    font-size: 14px;
}

.preview-container {
    position: relative;
}

.preview-container.hidden {
    display: none;
}

.screenshot-preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
}

.remove-preview {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-preview:hover {
    background: rgba(239, 68, 68, 0.8);
}

.btn-submit-payment {
    width: 100%;
    padding: 16px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit-payment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.btn-submit-payment:active {
    transform: translateY(0);
}
