
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f1f5f9;
    --accent: #10b981;
    --accent-hover: #059669;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
}

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

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0d1127 0%, #45237e 50%, #424484e2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 24px;
    line-height: 1.6;
    color: var(--text-primary);
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 32px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    display: block;
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.logo-title{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.header p {
    opacity: 0.9;
    font-size: 1.25rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

.main-content {
    padding: 48px 32px;
}

.upload-section {
    margin-bottom: 32px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 64px 32px;
    background: var(--bg-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-area:hover::before {
    opacity: 0.05;
}

.upload-area.dragover {
    border-color: var(--accent);
    background: #ecfdf5;
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow);
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.file-input {
    display: none;
}

.controls-section {
    display: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.platform-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.platform-tab {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

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

.platform-tab.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.selection-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: var(--bg-primary);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

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

.action-btn.download {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.action-btn.download:hover {
    background: var(--accent-hover);
}

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

.action-btn.active:hover {
    background: var(--primary-hover);
}

.loading {
    display: none;
    text-align: center;
    padding: 64px 32px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.loading-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px;
    border-radius: var(--radius);
    margin: 24px 0;
    display: none;
    font-weight: 500;
}

.stats-bar {
    display: none;
    background: var(--bg-secondary);
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 24px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
}

.preview-section {
    display: none;
}

.sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.size-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-height: 380px;
}

.size-card.visible {
    display: flex;
}

.size-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.size-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

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

.size-card.selected {
    border-color: var(--accent);
    background: #f0fdf4;
}

.size-card.selected::before {
    background: var(--accent);
    transform: scaleX(1);
}

.card-checkbox {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    z-index: 10;
}

.size-card.selected .card-checkbox {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.size-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 40px;
}

.size-badge {
    background: var(--secondary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.size-info {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.size-info p {
    margin: 6px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.size-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.preview-container {
    text-align: center;
    margin: 20px 0;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.preview-image {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.download-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    margin-top: auto;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.25);
}

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

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .header {
        padding: 32px 24px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1.1rem;
    }

    .logo-icon {
        font-size: 2.5rem;
    }

    .main-content {
        padding: 32px 24px;
    }

    .upload-area {
        padding: 48px 24px;
    }

    .upload-text {
        font-size: 1.1rem;
    }

    .upload-hint {
        font-size: 0.85rem;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .platform-tabs {
        justify-content: center;
        gap: 6px;
    }

    .platform-tab {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-width: auto;
        flex: 0 1 auto;
    }

    .selection-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .action-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        min-width: 120px;
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    .platform-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
    }

    .platform-tab {
        justify-content: center;
        text-align: center;
        padding: 12px 8px;
        font-size: 0.8rem;
    }

    .selection-actions {
        flex-direction: column;
        gap: 8px;
    }

    .action-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .controls-section {
        padding: 20px 16px;
    }

    .upload-text {
        font-size: 1rem;
    }

    .upload-hint {
        font-size: 0.8rem;
    }

    .header {
        padding: 28px 16px;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .header p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .logo-icon {
        font-size: 2.25rem;
    }

    .logo-title {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .platform-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .platform-tab {
        padding: 14px 10px;
        font-size: 0.75rem;
    }

    .platform-tab span {
        font-size: 1rem;
        margin-right: 4px;
    }

    .upload-area {
        padding: 40px 16px;
    }

    .upload-text {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .upload-hint {
        font-size: 0.75rem;
    }

    .header {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .header p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .logo-icon {
        font-size: 2rem;
    }

    .logo-title {
        gap: 8px;
    }
}

.brand-footer {
    background: var(--bg-secondary);
    padding: 24px 32px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 0.9rem;
}
