:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(37, 99, 235, 0.1);
    --transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-accents {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.accent {
    position: absolute;
    filter: blur(100px);
    opacity: 0.6;
    z-index: -1;
    border-radius: 50%;
}

.blob1 {
    top: -5%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(59,130,246,0.2) 0%, rgba(147,197,253,0) 70%);
}

.blob2 {
    bottom: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(167,139,250,0.15) 0%, rgba(221,214,254,0) 70%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.branding h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.branding h1 span {
    color: var(--primary-color);
}

.branding .subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
    letter-spacing: 0;
}

/* Search Bar */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-container input {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
    font-size: 1.125rem;
    font-family: inherit;
    border: 2px solid white;
    border-radius: 100px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    outline: none;
    transition: var(--transition);
}

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
    background: white;
}

/* Categories */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.category-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.category-btn:hover {
    border-color: #cbd5e1;
    color: var(--text-primary);
}

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

/* Promo Banner - Helppo Allekirjoitus Branding */
.promo-banner {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #002171 0%, #0570c9 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 600px;
    text-decoration: none;
    color: white;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(5, 112, 201, 0.25);
}

.promo-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(5, 112, 201, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
}

.ha-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 10px;
    margin-right: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ha-logo svg {
    width: 28px;
    height: 28px;
    color: #0570c9;
}

.promo-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.promo-text strong {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
}

.promo-text span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.promo-arrow {
    color: white;
    margin-left: 1rem;
    opacity: 0.8;
    transition: var(--transition);
}

.promo-banner:hover .promo-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.file-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: white;
    border-color: #e2e8f0;
}

.file-card-top {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.file-icon {
    font-size: 2.5rem;
    margin-right: 1.25rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    width: 65px;
    height: 65px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-info {
    flex-grow: 1;
    min-width: 0;
}

.file-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.pdf { background: #fee2e2; color: #b91c1c; }
.badge.word { background: #d0ebff; color: #1971c2; }
.badge.excel { background: #dcfce7; color: #166534; }
.badge.muu { background: #f1f5f9; color: #475569; }

.file-action {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.download-btn {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--primary-color);
    padding: 0.75rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.file-card:hover .download-btn {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 4rem;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

footer {
    text-align: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .branding h1 { font-size: 2.5rem; }
    .file-grid { grid-template-columns: 1fr; }
}
