/* Modern Color Palette */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--light-bg) 0%, #e0e7ff 100%);
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Enhanced Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, #1e40af 100%);
    color: white;
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,100 0,50"/></svg>') no-repeat center bottom;
    background-size: cover;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* Modern Navigation */
.nav {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: var(--gray-100);
    transform: translateY(-1px);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    color: var(--gray-600);
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
    border: 2px solid var(--gray-600);
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Enhanced Forms */
.form-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    margin: 2rem auto;
    border: 1px solid var(--gray-200);
}

.form-container h2 {
    color: var(--gray-900);
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-container p {
    color: var(--gray-600);
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--white);
}

.form-control:hover {
    border-color: var(--gray-400);
}

/* Main content */
.main-content {
    min-height: 60vh;
    margin: 2rem 0;
    padding: 0 1rem;
}

/* Welcome section */
.welcome-section {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    border: 1px solid var(--gray-200);
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
    font-weight: 700;
}

.welcome-section p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: var(--gray-600);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.auth-buttons {
    margin-top: 2rem;
}

/* Features section */
.features-section {
    margin-top: 4rem;
}

.features-section h3 {
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 3rem;
    color: var(--gray-900);
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
    font-weight: 700;
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.product-image-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 3rem;
    border-bottom: 1px solid var(--gray-200);
}

.product-info {
    padding: 2rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
    line-height: 1.4;
}

.product-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success-color);
    margin-bottom: 1.5rem;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Cart styling */
.cart-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--gray-200);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.75rem;
    background: var(--gray-100);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
    font-size: 1.125rem;
}

.cart-item-price {
    color: var(--success-color);
    font-weight: 600;
    font-size: 1rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--white);
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.cart-summary {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 2rem;
    border: 1px solid var(--gray-200);
}

.cart-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 0.5rem;
    text-align: center;
}

/* Orders */
.order-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.order-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.order-id {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.125rem;
}

.order-status {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-shipped {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid var(--primary-color);
}

.status-delivered {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid var(--success-color);
}

.order-items {
    margin-bottom: 1.5rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--gray-600);
    padding: 0.5rem 0;
}

.order-total {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: var(--success-color);
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-color: var(--primary-color);
}

/* Enhanced Footer */
.footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--gray-300);
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-600), transparent);
}

.footer p {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.25rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-container {
        margin: 1rem;
        padding: 2rem;
    }
    
    .welcome-section {
        padding: 3rem 1.5rem;
    }
    
    .features-section h3 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 0;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .welcome-section h2 {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .cart-summary {
        position: static;
        margin-top: 2rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
} 