@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e1b4b;
    --bg-tertiary: #111827;
    --card-bg: rgba(15, 23, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary), var(--bg-tertiary));
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    padding: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    box-shadow: var(--shadow-premium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
    box-shadow: 0 30px 60px -10px rgba(59, 130, 246, 0.15), var(--shadow-premium);
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 30px;
    font-weight: 400;
}

/* File Upload Drag & Drop Zone */
.dropzone-container {
    margin-bottom: 24px;
    text-align: left;
}

.dropzone-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.04);
    transform: translateY(-2px);
}

.dropzone.dragover {
    transform: scale(1.01) translateY(-2px);
    border-color: #60a5fa;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.dropzone:hover .dropzone-icon, .dropzone.dragover .dropzone-icon {
    color: var(--color-primary);
}

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

.dropzone-text span {
    color: var(--color-primary);
    font-weight: 600;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.6);
    margin-top: 6px;
}

#file-info {
    display: none;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
    animation: fadeIn 0.3s ease;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.file-icon {
    color: var(--color-primary);
    font-size: 1.2rem;
}

.remove-file {
    color: var(--color-danger);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    background: none;
    border: none;
    padding: 4px 8px;
}

/* Form Inputs */
.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 16px;
    border-radius: 16px;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

textarea:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button */
button[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #60a5fa 0%, var(--color-primary-hover) 100%);
}

button[type="submit"]:active {
    transform: translateY(1px);
}

/* Results Formatting */
.result-box {
    text-align: center;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    position: relative;
}

.gauge-svg {
    width: 180px;
    height: 180px;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 10;
}

.gauge-fill {
    fill: none;
    stroke: var(--color-primary);
    stroke-dasharray: 471.2;
    stroke-dashoffset: 471.2;
    stroke-linecap: round;
    stroke-width: 10;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-score {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

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

/* Rating Pill */
.rating-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

.rating-excellent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.rating-good {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.rating-average {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.rating-low {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Stats Metadata */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    font-size: 0.95rem;
}

.stat-card strong {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 8px;
}

/* Keyword Cloud */
.keyword-section {
    text-align: left;
    margin-bottom: 32px;
}

.keyword-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.keyword-tag {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    transform: translateY(-1px);
}

.green .keyword-tag {
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.red .keyword-tag {
    background: rgba(244, 63, 94, 0.08);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.15);
}

.no-keywords {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* Optimization Tips Card */
.tips-card {
    background: rgba(59, 130, 246, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: left;
}

.tips-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-list {
    list-style: none;
}

.tips-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    line-height: 1.5;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.tips-list li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: #60a5fa;
}

/* Back Link Button */
.back-btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Utilities */
.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 14px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

footer {
    margin-top: auto;
    padding: 30px 20px 20px;
    color: rgba(148, 163, 184, 0.4);
    font-size: 0.85rem;
    text-align: center;
    font-weight: 400;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .container {
        padding: 24px;
        margin-top: 20px;
    }
    h1 {
        font-size: 1.8rem;
    }
}
