/* 
 * Digital Products Store - Main Stylesheet
 * Professional, modern, and clean design
 */

/* CSS Variables - Theme System */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B83FF;
    --secondary: #2D2D3F;
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A6A;
    --text-light: #8A8AA8;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FE;
    --bg-dark: #1A1A2E;
    --success: #00C897;
    --warning: #FFB84D;
    --error: #FF6B6B;
    --info: #4A9EFF;
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container-width: 1200px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
}

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

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 24px;
    color: var(--text-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-login {
    color: var(--primary);
    font-weight: 600;
}

.btn-register {
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: var(--border-radius-sm);
}

.btn-register:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-logout {
    background: var(--error);
    color: white;
    padding: 8px 20px;
    border-radius: var(--border-radius-sm);
}

.btn-logout:hover {
    background: #e55555;
    color: white;
}

/* Mobile Nav */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 22px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features */
.features {
    padding: 80px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-card i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    background: var(--bg-secondary);
    padding: 20px;
    text-align: center;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

/* Alerts */
.alert {
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    margin: 20px auto;
    max-width: var(--container-width);
    font-weight: 500;
}

.alert-error {
    background: #FFEBEB;
    color: var(--error);
    border-left: 4px solid var(--error);
}

.alert-success {
    background: #E6F9F2;
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-info {
    background: #E6F0FF;
    color: var(--info);
    border-left: 4px solid var(--info);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 16px;
}

.footer-section p {
    color: rgba(255,255,255,0.6);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 20px 0;
        gap: 16px;
        background: white;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .payment-features {
        grid-template-columns: 1fr 1fr;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-20 { gap: 20px; }