/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Properties */
:root {
    /* Colors - Flor de Bahía Theme */
    --primary: #00A693;        /* Deep teal from shirt */
    --primary-dark: #00796B;   /* Darker teal */
    --primary-light: #26C6DA;  /* Light turquoise */
    --secondary: #9B59B6;      /* Purple from flower */
    --secondary-dark: #8E44AD; /* Darker purple */
    --accent: #2E86AB;         /* Blue from whale */
    --accent-dark: #1976D2;    /* Darker blue */
    
    --success: #00C853;        /* Tropical green */
    --warning: #FF9800;        /* Sunset orange */
    --error: #E91E63;          /* Tropical pink */
    
    --bg-primary: #0D1B2A;     /* Deep ocean night */
    --bg-secondary: #1B263B;   /* Ocean depth */
    --bg-tertiary: #1E3A5F;    /* Deep water */
    --bg-modal: rgba(13, 27, 42, 0.95);
    
    --text-primary: #ffffff;
    --text-secondary: #E1F5FE;  /* Light ocean foam */
    --text-muted: #81D4FA;     /* Ocean mist */
    --text-accent: #26C6DA;    /* Turquoise accent */
    
    --border: rgba(38, 198, 218, 0.2);      /* Turquoise border */
    --border-light: rgba(38, 198, 218, 0.1); /* Light turquoise border */
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(0, 166, 147, 0.4);  /* Teal glow */
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Base Styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, #0F2027 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 166, 147, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(46, 134, 171, 0.15) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

/* Whale Tail Pattern - Iconic Uvita Beach Shape */
.whale-tail-pattern {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 150px;
    opacity: 0.1;
    background: linear-gradient(45deg, var(--primary-light) 0%, var(--accent) 100%);
    clip-path: polygon(
        50% 100%, 
        0% 60%, 
        20% 40%, 
        35% 45%, 
        50% 30%, 
        65% 45%, 
        80% 40%, 
        100% 60%
    );
    animation: whaleTailPulse 6s ease-in-out infinite alternate;
}

@keyframes whaleTailPulse {
    0% { 
        opacity: 0.1; 
        transform: translateX(-50%) scale(1);
    }
    100% { 
        opacity: 0.2; 
        transform: translateX(-50%) scale(1.1);
    }
}

/* Ocean Waves Pattern */
.ocean-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, rgba(38, 198, 218, 0.1));
    overflow: hidden;
}

.ocean-waves::before,
.ocean-waves::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,40 C200,10 400,70 600,40 C800,10 1000,70 1200,40 L1200,120 L0,120 Z' fill='%2326C6DA' fill-opacity='0.1'/%3E%3C/svg%3E") repeat-x;
    animation: wave 8s linear infinite;
}

.ocean-waves::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,60 C300,20 600,80 900,60 C1000,50 1100,70 1200,60 L1200,120 L0,120 Z' fill='%23009688' fill-opacity='0.08'/%3E%3C/svg%3E") repeat-x;
    animation: wave 12s linear infinite reverse;
    height: 30px;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-1200px); }
}

@keyframes heroGlow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.8;
    color: var(--primary-light);
    filter: drop-shadow(0 0 10px rgba(38, 198, 218, 0.3));
}

.shape-1 { top: 20%; left: 10%; animation-delay: 0s; }
.shape-2 { top: 15%; right: 15%; animation-delay: 1s; }
.shape-3 { bottom: 30%; left: 15%; animation-delay: 2s; }
.shape-4 { top: 60%; right: 10%; animation-delay: 3s; }
.shape-5 { bottom: 20%; right: 30%; animation-delay: 4s; }
.shape-6 { top: 40%; left: 20%; animation-delay: 5s; }
.shape-7 { top: 70%; left: 70%; animation-delay: 1.5s; }
.shape-8 { bottom: 50%; right: 60%; animation-delay: 3.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(-10px) rotate(-5deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShine 3s ease-in-out infinite alternate;
}

@keyframes titleShine {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.3); }
}

.title-main {
    display: block;
}

.title-highlight {
    display: block;
    font-weight: 700;
    font-size: 1.2em;
}

.title-subtitle {
    display: block;
    font-size: 0.7em;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    opacity: 0.9;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin-bottom: var(--space-2xl);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.7;
}

/* Contest Stats */
.contest-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    animation: statPulse 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(38, 198, 218, 0.1), transparent);
    transition: left 3s ease-in-out infinite;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: -100%; }
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-light);
    background: rgba(0, 166, 147, 0.1);
}

@keyframes statPulse {
    0% { box-shadow: 0 0 10px rgba(0, 166, 147, 0.3); }
    100% { box-shadow: 0 0 20px rgba(38, 198, 218, 0.5); }
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    display: block;
    filter: drop-shadow(0 0 5px rgba(38, 198, 218, 0.4));
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'Fredoka', sans-serif;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: var(--space-lg) var(--space-2xl);
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    font-family: 'Fredoka', sans-serif;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.cta-btn:hover::before {
    left: 100%;
}

.cta-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-lg);
}

.cta-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.1);
}

.cta-btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-md);
}

.cta-btn.secondary:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

/* Quick Access Bar */
.quick-access {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-modal);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) 0;
}

.quick-access-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.login-toggle-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.login-toggle-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 166, 147, 0.3);
}

.quick-filters {
    display: flex;
    gap: var(--space-sm);
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 8px rgba(0, 166, 147, 0.3);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--space-lg);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content.large {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    z-index: 1;
}

.modal-close:hover {
    color: var(--primary-light);
}

.modal-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.modal-header h2 {
    color: var(--primary-light);
    margin-bottom: var(--space-sm);
}

.modal-header p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 147, 0.2);
    background: rgba(0, 166, 147, 0.05);
}

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

.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn-primary,
.btn-secondary {
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.1);
}

.btn-primary.large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.1rem;
    min-width: 200px;
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

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

/* Upload Area */
.upload-section {
    margin-bottom: var(--space-2xl);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    background: var(--bg-tertiary);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 166, 147, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(155, 89, 182, 0.05) 0%, transparent 50%);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(0, 166, 147, 0.05);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: var(--secondary);
    background: rgba(155, 89, 182, 0.05);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    color: var(--primary-light);
}

.upload-content h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.upload-content small {
    color: var(--text-muted);
}

/* Preview Section */
.preview-section {
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

#image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.mockup-preview {
    text-align: center;
}

.tshirt-mockup {
    position: relative;
    max-width: 200px;
    margin: 0 auto var(--space-md);
}

.mockup-base {
    width: 100%;
    height: auto;
}

.design-overlay {
    position: absolute;
    top: 20%;
    left: 20%;
    right: 20%;
    bottom: 40%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    align-items: center;
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    max-width: 300px;
    flex: 1;
}

.search-box input {
    padding-right: 40px;
}

.search-icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.sort-controls select {
    min-width: 150px;
}

/* Leaderboard */
.leaderboard-section {
    margin-bottom: var(--space-3xl);
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

/* Design Grid */
.gallery-section {
    margin-bottom: var(--space-3xl);
}

.designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-2xl) 0;
}

.design-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
    cursor: pointer;
}

.design-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    transform-origin: left;
}

.design-card:hover::before {
    transform: scaleX(1);
}

.design-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-light);
}

.design-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.design-card:hover img {
    transform: scale(1.05);
}

.design-info {
    padding: var(--space-lg);
}

.design-info h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.design-info p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

.designer {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: var(--space-md);
}

/* Vote Button */
.vote-btn {
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.vote-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.vote-btn:hover::before {
    left: 100%;
}

.vote-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 166, 147, 0.4);
    filter: brightness(1.1);
}

.vote-btn.voted {
    background: var(--success);
    cursor: default;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: var(--space-2xl);
}

.load-more-btn {
    padding: var(--space-lg) var(--space-2xl);
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 600;
}

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

/* User Profile Popup */
.user-profile-popup {
    position: fixed;
    top: 80px;
    right: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    min-width: 250px;
    transform: translateY(-10px);
    opacity: 0;
    transition: all var(--transition-normal);
}

.user-profile-popup.active {
    transform: translateY(0);
    opacity: 1;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    position: relative;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.profile-info h3 {
    margin: 0;
    font-size: 1rem;
}

.profile-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-close {
    position: absolute;
    top: -5px;
    right: -5px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.stat-item {
    text-align: center;
}

.stat-item .stat-number {
    display: block;
    font-weight: 700;
    color: var(--primary-light);
    font-size: 1.2rem;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: all var(--transition-normal);
    max-width: 350px;
    position: relative;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: var(--space-sm);
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: var(--space-lg);
        min-height: 80vh;
    }
    
    .contest-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .quick-access-content {
        flex-direction: column;
        gap: var(--space-md);
        padding: 0 var(--space-md);
    }
    
    .quick-filters {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal-content {
        margin: var(--space-md);
        padding: var(--space-lg);
    }
    
    .preview-container {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .gallery-controls {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .search-box {
        max-width: none;
        width: 100%;
    }
    
    .designs-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .user-profile-popup {
        right: var(--space-md);
        left: var(--space-md);
        top: 70px;
    }
}

@media (max-width: 480px) {
    .contest-stats {
        grid-template-columns: 1fr;
        max-width: 200px;
    }
    
    .stat-card {
        padding: var(--space-md);
    }
    
    .main-content {
        padding: var(--space-lg) var(--space-md);
    }
    
    .leaderboard-grid,
    .designs-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-overlay {
        align-items: flex-start;
        padding: var(--space-md);
    }
    
    .modal-content {
        margin-top: var(--space-lg);
    }
}

/* Loading states */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--space-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty states */
.no-designs {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.error {
    text-align: center;
    padding: var(--space-2xl);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-xl);
    color: var(--error);
}

/* Utility Classes */
.hidden { display: none !important; }
.sr-only { 
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
} 