/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary: #00D084;
    --primary-dim: #00a669;
    --primary-glow: rgba(0, 208, 132, 0.4);

    --accent-blue: #4285F4;
    --accent-red: #FF4D4D;
    --accent-yellow: #FFB02E;

    /* Dark Theme Palette */
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-card-glass: rgba(30, 41, 59, 0.7);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;

    /* Spacing System - Mobile Optimized */
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Animation */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
}

/* --- Layout Shell --- */
#app {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

main {
    flex: 1;
    padding: var(--space-md);
    padding-bottom: 90px !important;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* --- Branding --- */
.goga-logo {
    font-weight: 800;
    display: inline-flex;
    gap: 2px;
    direction: ltr;
    unicode-bidi: isolate;
    justify-content: center;
}

.c-blue {
    color: var(--accent-blue);
}

.c-red {
    color: var(--accent-red);
}

.c-yellow {
    color: var(--accent-yellow);
}

.c-green {
    color: var(--primary);
}

.goga-logo.large {
    font-size: 2.5rem;
}

.goga-logo.x-large {
    font-size: 3.5rem;
}

/* --- Splash Screen --- */
#splash-screen {
    position: fixed;
    inset: 0;
    background-color: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease 2.0s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* --- Header --- */
header {
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

header.scrolled {
    border-bottom-color: var(--border);
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-xs);
}

h1 {
    font-size: 1.75rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.1rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- Components: Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    opacity: 0.5;
}

.card:active {
    transform: scale(0.99);
}

/* --- Inputs --- */
.form-group {
    margin-bottom: var(--space-md);
}

label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #0f172a;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 208, 132, 0.15);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.2s var(--ease-bounce);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    box-shadow: none;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}

/* --- View Transitions --- */
.view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* --- Nav Footer --- */
.nav-footer-area {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

/* --- Bottom Navigation Bar --- */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    z-index: 2000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
    padding: 4px;
}

.nav-item .icon {
    font-size: 1.3rem;
    transition: transform 0.2s var(--ease-bounce);
}

.nav-item .label {
    font-size: 0.65rem;
    font-weight: 600;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .icon {
    transform: translateY(-3px);
}

/* --- Chat Specifics --- */
#chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    position: relative;
    line-height: 1.5;
}

.msg.ai {
    background: var(--bg-card);
    border-bottom-right-radius: 4px;
    color: var(--text-main);
}

.msg.user {
    background: var(--accent-blue);
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

#chat-input-area {
    padding: var(--space-sm);
    background: var(--bg-card);
    display: flex;
    gap: var(--space-sm);
    border-radius: var(--radius-md);
    margin: var(--space-sm) 0;
}

#btn-send-chat {
    width: auto;
    padding: 0 18px;
    margin: 0;
}

/* --- Quiz UI --- */
.quiz-option {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(0, 208, 132, 0.1);
}

/* --- Risk Badges --- */
.risk-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.risk-low {
    background: var(--primary);
    color: #000;
}

.risk-medium {
    background: var(--accent-yellow);
    color: #000;
}

.risk-high {
    background: var(--accent-red);
    color: #fff;
}

.risk-critical {
    background: #ff0000;
    color: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

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

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.checklist input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* --- Hero Section --- */
.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    text-align: center;
}

.hero-container img {
    max-width: 75%;
    width: 200px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(0, 208, 132, 0.2));
}

/* --- Mobile Optimizations --- */
@media (max-width: 375px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .goga-logo.large {
        font-size: 2rem;
    }

    .goga-logo.x-large {
        font-size: 3rem;
    }

    .btn {
        padding: 12px;
        font-size: 0.9rem;
    }

    .card {
        padding: 12px;
    }

    main {
        padding: 12px;
    }
}