:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    right: -100px;
    animation: move-1 20s infinite alternate;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: -50px;
    left: -50px;
    animation: move-2 25s infinite alternate;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #ec4899;
    top: 40%;
    left: 20%;
    animation: move-3 18s infinite alternate;
}

@keyframes move-1 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-30%, 40%);
    }
}

@keyframes move-2 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40%, -20%);
    }
}

@keyframes move-3 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-10%, -30%);
    }
}

/* Container & Hero */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin: 2rem 0;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    margin-bottom: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.25rem;
    color: var(--text-main);
}

/* Dashboard Table */
.table-responsive {
    overflow-x: auto;
}

.dashboard-table,
.settings-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.dashboard-table th,
.settings-table th {
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-table td,
.settings-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.dashboard-table tr:hover,
.settings-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dashboard-table tr:last-child td,
.settings-table tr:last-child td,
.inspector-table tr:last-child td {
    border-bottom: none;
}

.inspector-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.inspector-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.inspector-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.clickable-row {
    cursor: pointer;
}

.symbol-cell {
    display: flex;
    flex-direction: column;
}

.symbol-cell .name {
    font-weight: 600;
}

.symbol-cell .code {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Analysis Section */
.search-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0.5rem;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.75rem;
    font-size: 1.1rem;
    outline: none;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: var(--primary);
    color: white;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.tag:hover {
    background: var(--primary);
    color: white;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.valuation-card.highlight {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(129, 140, 248, 0.3);
}

.expected-price {
    text-align: center;
    margin: 1.5rem 0;
}

.expected-price .value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--success);
}

.valuation-meta {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Quality Metrics */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.q-metric {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.q-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.q-val {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Chart Container */
.chart-container {
    height: 300px;
    width: 100%;
}

/* Settings Form */
.settings-form {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.settings-form input,
.settings-form select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    outline: none;
}

.settings-form input[type="text"] {
    flex: 2;
}

.settings-form select {
    flex: 1;
}

.settings-form input[type="number"] {
    flex: 1;
}

.mt-20 {
    margin-top: 20px;
}

/* Loading Overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#loadingOverlay[hidden] {
    display: none !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-form {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2.25rem;
    }
}