/* Base & Variables */
:root {
    --primary: #FF6B6B;
    --primary-glow: rgba(255, 107, 107, 0.4);
    --secondary: #FFA8A8;
    --accent: #51CF66;
    --accent-glow: rgba(81, 207, 102, 0.3);
    --warning: #FCC419;
    --bg-color: #1A0A0F;
    --surface: #261219;
    --surface-hover: #331A22;
    --border: rgba(255, 107, 107, 0.15);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-glow: 0 8px 32px 0 rgba(255, 107, 107, 0.1);
}

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

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(255, 107, 107, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(81, 207, 102, 0.03) 0%, transparent 40%);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 1100px;
    padding: 40px 24px;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 8px;
}

/* Header */
.header {
    margin-bottom: 40px;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-content h1 {
    background: linear-gradient(135deg, var(--text-primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
    font-weight: 700;
}

/* Glass Panel */
.glass-panel {
    background: rgba(38, 18, 25, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(255, 107, 107, 0.3);
    box-shadow: 0 8px 32px 0 rgba(255, 107, 107, 0.15);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.error-text {
    color: var(--primary);
}

.error-text:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Input Section */
.input-section {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-area {
    position: relative;
    height: 280px;
}

textarea {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--surface-hover);
    border-radius: 8px;
    padding: 16px;
    color: var(--text-primary);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(38, 18, 25, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 1;
}

.upload-overlay:hover,
.upload-overlay.dragover {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
}

.upload-overlay p {
    color: var(--text-primary);
    font-weight: 500;
}

.upload-overlay .text-sm {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.upload-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Results section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score Card */
.score-card {
    display: flex;
    align-items: center;
    gap: 32px;
    background: linear-gradient(135deg, rgba(38, 18, 25, 0.9), rgba(26, 10, 15, 0.9));
}

.score-details h2 {
    font-size: 2rem;
    margin-bottom: 4px;
    transition: color 0.3s;
}

/* Circular Chart */
.score-circle {
    width: 120px;
    height: 120px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out, stroke 0.4s ease;
}

.percentage {
    fill: var(--text-primary);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.5em;
    text-anchor: middle;
}

/* Colors for score paths */
.score-green {
    stroke: var(--accent);
}

.score-yellow {
    stroke: var(--warning);
}

.score-red {
    stroke: var(--primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.grid-span-full {
    grid-column: 1 / -1;
}

.check-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--secondary);
    border-bottom: 1px solid var(--surface-hover);
    padding-bottom: 12px;
}

/* Checklist */
.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.check-item.pass {
    border-left-color: var(--accent);
}

.check-item.fail {
    border-left-color: var(--primary);
}

.check-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.pass-icon {
    color: var(--accent);
}

.fail-icon {
    color: var(--primary);
}

.check-content strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.check-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.code-tag {
    background: var(--surface-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--secondary);
}

/* Icons Grid */
.icons-summary {
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.icon-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 16px;
}

.icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.icon-thumb {
    width: 48px;
    height: 48px;
    background: var(--surface-hover);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px dashed var(--border);
}

.icon-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.icon-box span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Theme Preview */
.theme-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.theme-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.app-window-preview {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-top: 8px;
}

.app-titlebar {
    height: 28px;
    background: #333;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
    transition: background 0.3s ease;
}

.app-dots {
    display: flex;
    gap: 6px;
}

.app-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.5;
}

.app-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.8;
}

.app-body {
    height: 120px;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: background 0.3s ease;
}

.app-icon-large {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-hover);
}

.app-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.section-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .score-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}