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

:root {
    /* Minimalist Light Theme */
    --bg-main: #FFFFFF;
    --bg-alt: #F9FAFB;
    --bg-card: #FFFFFF;
    
    --border-color: #E5E7EB;
    --border-dark: #D1D5DB;
    
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    
    /* Belåningsgrad Brand Colors */
    --primary: #0B1B3D; /* Midnight Blue */
    --primary-hover: #162B54;
    
    --success: #10B981; /* Mint Green */
    --warning: #F59E0B; /* Amber */
    --danger: #EF4444; /* Red */
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Sharp corners for professional look */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-full: 4px; /* We overwrite 'full' to be sharp to remove all pill-buttons */
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-alt);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography Refinements */
h1, h2, h3, h4 {
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* Navigation */
.navbar {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo span {
    color: var(--text-muted);
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Buttons (Sharp, minimalist) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

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

.btn-outline {
    background-color: var(--bg-main);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background-color: var(--bg-alt);
}

.btn-premium {
    background-color: var(--primary);
    color: #FFFFFF;
}

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

.btn-text {
    background: none;
    color: var(--text-secondary);
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

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

/* Hero Section (Unique Identity - Toned Down) */
.hero {
    padding: 120px 0 100px;
    text-align: center;
    background-color: var(--primary); /* Midnight Blue */
    /* Subtile Architectural Grid Pattern */
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

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

.hero h1 {
    font-size: 58px; /* Slightly scaled down */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}

.hero p {
    font-size: 19px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 48px;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar (Toned down Glassmorphism) */
.search-drop-container {
    max-width: 650px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 32px;
    position: relative;
    z-index: 10;
}

.search-bar {
    display: flex;
    background: #F9FAFB;
    border: 2px solid transparent;
    padding: 4px 4px 4px 16px;
    align-items: center;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: var(--text-muted);
    font-size: 16px;
    margin-right: 12px;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 16px;
}

.drop-zone {
    border: 2px dashed #E5E7EB;
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    background: #F9FAFB;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: #EFF6FF;
}

.drop-icon {
    font-size: 40px;
    color: #9CA3AF;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.drop-zone:hover .drop-icon {
    color: var(--primary);
}

.drop-zone h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.drop-zone p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* AI Loading Animation */
.ai-scanner {
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(to bottom, rgba(37,99,235,0) 0%, rgba(37,99,235,0.1) 50%, rgba(37,99,235,0) 100%);
    animation: scan 2s infinite linear;
    pointer-events: none;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.loading-text-container {
    position: relative;
    z-index: 2;
    color: var(--primary);
    font-weight: 600;
    font-size: 15px;
    margin-top: 16px;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    list-style: none;
    text-align: left;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.search-results li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover {
    background: var(--bg-alt);
}

/* Dashboard Structure */
.dashboard {
    padding: 40px 0;
}

.certificate-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    padding: 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.certificate-card .watermark {
    position: absolute;
    top: 50%;
    right: -5%;
    transform: translateY(-50%);
    font-size: 250px;
    color: rgba(0,0,0,0.02);
    z-index: 0;
    pointer-events: none;
}

.dashboard-header {
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.dashboard-header h2 {
    font-size: 32px;
    margin: 16px 0 8px;
}

.badges {
    display: flex;
    gap: 8px;
}

.badge {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge.verified {
    background: #F0FDF4;
    color: var(--success);
    border-color: #BBF7D0;
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: 1fr; }
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.metric-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.metric-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-value {
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.metric-value .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.metric-value .unit {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Progress Bars (Flat and corporate) */
.progress-bar-container {
    height: 6px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
}

.bg-yellow { background-color: var(--warning); }
.bg-orange { background-color: var(--danger); }
.bg-green { background-color: var(--success); }

.icon-blue, .icon-orange, .icon-green {
    /* Remove colors from icons to keep it austere */
    color: var(--text-muted);
}

.metric-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Paywall / Freemium */
.premium-container {
    position: relative;
    border-radius: var(--radius-md);
}

.premium-container.unlocked .premium-overlay {
    display: none;
}

.premium-container.unlocked .premium-content {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.premium-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.overlay-content {
    background: var(--bg-main);
    padding: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dark);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.overlay-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.premium-content {
    transition: var(--transition);
    filter: blur(8px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

/* Timeline */
.timeline { position: relative; padding-left: 20px; margin-top: 16px; }
.timeline::before { content:''; position:absolute; left:5px; top:0; bottom:0; width:1px; background:var(--border-color); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before { content:''; position:absolute; left:-20px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--bg-main); border:1px solid var(--border-dark); z-index:2; }
.timeline-item.done::before { background:var(--bg-main); border-color:var(--success); }
.timeline-item.warning::before { background:var(--bg-main); border-color:var(--danger); }
.timeline-year { font-size:12px; font-weight:600; color:var(--text-muted); margin-bottom:2px; }
.timeline-title { font-size:14px; font-weight:500; color:var(--text-primary); }

/* Inputs and Forms */
input[type="number"], input[type="text"], select {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

input[type="number"]:focus, input[type="text"]:focus, select:focus {
    border-color: var(--primary);
}

/* Modal */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:1000; display:flex; align-items:center; justify-content:center; }
.modal-content { background:var(--bg-main); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:32px; width:100%; max-height:90vh; overflow-y:auto; position:relative; box-shadow:0 20px 25px -5px rgba(0,0,0,0.1); }
.close-modal { position:absolute; top:20px; right:20px; background:none; border:none; color:var(--text-muted); font-size:20px; cursor:pointer; }
.close-modal:hover { color:var(--text-primary); }

/* Battle rows */
.battle-row { display:flex; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--border-color); align-items:center; }
.battle-row:last-child { border:none; }
.battle-label { flex:1; text-align:center; font-size:13px; color:var(--text-secondary); }
.battle-val { flex:1; font-size:16px; font-weight:600; color:var(--text-primary); }
.battle-val.a { text-align:right; }
.battle-val.b { text-align:left; }
.battle-win { color:var(--success); }
.battle-lose { color:var(--text-muted); text-decoration: line-through; opacity: 0.5; }

/* Premium Dark Footer */
.site-footer {
    background: var(--primary); /* Dark background */
    color: #FFFFFF;
    padding: 80px 0 0 0;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    margin-bottom: 64px;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

.footer-brand .logo {
    color: #FFFFFF;
}

.footer-brand .logo span {
    color: rgba(255, 255, 255, 0.5);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.6;
    margin-top: 20px;
    max-width: 320px;
}

.footer-links {
    display: flex;
    gap: 80px;
}

@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 40px;
    }
}

.link-group h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    color: #FFFFFF;
}

.link-group a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.link-group a:hover {
    color: #FFFFFF;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 0;
    text-align: left;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* Utilities */
.hidden { display: none !important; }
