/* --- ცვლადები და ფერები --- */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-gold: #fbbf24;  /* ოქროსფერი */
    --accent-purple: #818cf8; /* იასამნისფერი */
    --accent-white: #e2e8f0;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- ფონტების შემოტანა --- */
/* შენიშვნა: დარწმუნდით, რომ ფონტები სწორ საქაღალდეშია static/fonts/ */
@font-face {
    font-family: 'HamburgSymbols';
    src: url('../fonts/HamburgSymbols.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'BPG Algeti';
    src: url('../fonts/bpg-algeti-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* --- გლობალური სტილები --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    font-family: 'BPG Algeti', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Header & Navigation --- */
header {
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-gold);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
    z-index: 101;
}
.logo-img { height: 35px; width: auto; object-fit: contain; }
.logo:hover { transform: scale(1.05); }

nav { display: flex; align-items: center; gap: 20px; }

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
    padding: 8px 15px;
    border-radius: 6px;
}
nav a:hover { color: var(--accent-gold); background: rgba(255, 255, 255, 0.05); }

/* --- Main Layout --- */
main { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

/* --- Hero Section --- */
.hero { text-align: center; padding: 3rem 1rem; margin-bottom: 2rem; }
.hero h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #fff, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.3));
}
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* --- Service Cards --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.service-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-purple);
    background: rgba(30, 41, 59, 0.5);
}
.card-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.service-card h3 { color: var(--accent-gold); margin-bottom: 0.5rem; }
.service-card p { color: var(--text-muted); font-size: 0.9rem; }

/* --- Form Styling --- */
.form-container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 20px;
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    max-width: 600px;
    margin: 0 auto;
}
input, select, button {
    width: 100%; padding: 12px; margin-bottom: 15px; border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(15, 23, 42, 0.6);
    color: white; font-size: 1rem; font-family: 'BPG Algeti', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}

button {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6366f1 100%);
    border: none; font-weight: bold; cursor: pointer; margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}
button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* --- AI Text Typography --- */
.ai-text {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-main);
}
.ai-text h3 {
    color: var(--accent-gold);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}
.ai-text p { margin-bottom: 1.2rem; text-align: left; }
.ai-text ul, .ai-text ol { margin-bottom: 1.2rem; padding-left: 20px; }
.ai-text li { margin-bottom: 5px; padding-left: 5px; }
.ai-text strong, .ai-text b { color: #fff; font-weight: 600; }

/* --- Footer --- */
footer {
    text-align: center; padding: 2rem;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-muted);
    border-top: var(--glass-border);
    font-size: 0.9rem; margin-top: auto;
}

/* --- Result Page Styles --- */
.astro-symbol { font-family: 'HamburgSymbols', sans-serif; font-size: 1.5rem; line-height: 1; display: inline-block; vertical-align: middle; margin-right: 8px; font-weight: normal; }
.dashboard-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; width: 100%; }
.left-column, .info-wrapper { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.chart-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 15px;
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.chart-wrapper img { width: 100%; height: auto; max-width: 100%; filter: drop-shadow(0 0 20px rgba(129,140,248,0.2)); }

.info-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    padding: 25px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: transform 0.3s;
}
.info-card:hover { border-color: rgba(255, 255, 255, 0.2); }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compact-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.compact-table th { text-align: left; color: var(--text-muted); padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
.compact-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; vertical-align: middle; }
.compact-table tr:last-child td { border-bottom: none; }

.stat-row { display: flex; align-items: center; margin-bottom: 15px; font-size: 0.9rem; }
.stat-icon-wrapper { width: 30px; display: flex; justify-content: center; margin-right: 10px; color: var(--accent-gold); flex-shrink: 0; }
.stat-label { width: 70px; color: var(--text-muted); flex-shrink: 0; }
.stat-bar-bg { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin: 0 10px; }
.stat-bar-fill { height: 100%; border-radius: 3px; }
.stat-value { width: 20px; text-align: right; font-weight: bold; flex-shrink: 0; }

/* --- LOADING TEXT ANIMATION --- */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.loading-text {
    font-size: 0.9rem;
    color: var(--accent-white);
    font-weight: normal;
    font-style: italic;
    animation: pulse 1.5s infinite ease-in-out;
    display: none; /* JS ჩართავს */
    margin-left: auto;
}

/* --- KNOWLEDGE LEVEL CARDS (ახალი დამატება) --- */
.knowledge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

.knowledge-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.knowledge-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.knowledge-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* აქტიური მდგომარეობა */
.knowledge-card:has(input:checked) {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.knowledge-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
}

.knowledge-card .card-icon {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0; /* გადაწერა სერვის ქარდის სტილის */
}

.knowledge-card:has(input:checked) .card-icon {
    background: var(--accent-purple);
    color: white;
}

.knowledge-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.knowledge-card:has(input:checked) .card-desc {
    color: rgba(255, 255, 255, 0.9);
}

.check-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--accent-purple);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.knowledge-card:has(input:checked) .check-mark {
    opacity: 1;
    transform: scale(1);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
    .dashboard-container { grid-template-columns: 1fr; }
    .left-column { order: -1; }
    .info-card { padding: 20px; }
}

@media (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
    }
    .menu-toggle { display: flex; }
    .logo { margin-bottom: 0; justify-content: flex-center; }
    .logo-img { height: 40px; }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(17, 24, 39, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(255,255,255,0.1);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 15px;
        z-index: 999;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    nav.active { display: flex; }
    nav a { width: 90%; text-align: center; padding: 14px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; font-size: 1.1rem; }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        background: transparent;
        border: none;
        z-index: 1002;
        padding: 0;
    }
    .menu-toggle span { width: 100%; height: 3px; background-color: var(--text-main); border-radius: 3px; transition: all 0.3s ease-in-out; }
    .menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    main { padding: 1.5rem 1rem; }
    .hero h1 { font-size: 2rem; }
    .form-container { padding: 1.5rem; }
}