:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;
    --white: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
}

.intro {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    border-left: 4px solid var(--primary);
}

.intro p {
    margin-bottom: 0.5rem;
}

.intro p:last-child {
    margin-bottom: 0;
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.challenge-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.challenge-number {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.challenge-card h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.challenge-description {
    color: var(--gray);
    margin-bottom: 1.5rem;
    min-height: 80px;
}

.challenge-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.challenge-meta span {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.difficulty {
    background: var(--light-gray);
    color: var(--dark);
}

.difficulty.medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty.hard {
    background: #fee2e2;
    color: #991b1b;
}

.type {
    background: #ddd6fe;
    color: #5b21b6;
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.tips {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.tips h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    color: var(--gray);
}

/* Challenge Pages Styles */
.challenge-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    transform: translateX(-5px);
}

.challenge-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.challenge-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.challenge-content {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-success:hover {
    background: #059669;
    transform: scale(1.05);
}

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

.btn-warning:hover {
    background: #d97706;
}

.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.product-price {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.profile-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--white);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.avatar-section {
    flex-shrink: 0;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--white);
}

.user-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.user-info p {
    color: var(--gray);
}

.cart-item {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info h3 {
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-total {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    text-align: right;
}

.cart-total h3 {
    font-size: 1.5rem;
    color: var(--dark);
}

@media (max-width: 768px) {
    .container, .challenge-container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .challenges-grid {
        grid-template-columns: 1fr;
    }

    .profile-content {
        flex-direction: column;
        text-align: center;
    }
}
