:root {
    --bg-color: #080b11;
    --card-bg: rgba(17, 25, 40, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.4);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
    
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Blobs */
.background-glows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
}

.glow-1 {
    top: -10%;
    right: 15%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #3b82f6 0%, #4f46e5 100%);
}

.glow-2 {
    bottom: 10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6 0%, #d946ef 100%);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

header h1 {
    font-family: var(--font-header);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(79, 70, 229, 0.2);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 30px;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background-color: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: translateY(-5px);
}

.drop-zone h3 {
    font-family: var(--font-header);
    font-size: 20px;
    font-weight: 600;
}

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

.file-format-limit {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(79, 70, 229, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--primary-glow);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Container */
.error-message {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #fca5a5;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.error-icon {
    font-size: 20px;
}

/* Results Card */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.verdict-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.verdict-badge.original {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.verdict-badge.suspicious {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.verdict-badge.fake {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.confidence-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gauge-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.gauge-value {
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 24px;
}

/* Warnings Box */
.warnings-box {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.warnings-box h4 {
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.warnings-box ul {
    list-style-type: none;
}

.warnings-box li {
    font-size: 13px;
    color: #fca5a5;
    margin-bottom: 4px;
    padding-left: 14px;
    position: relative;
}

.warnings-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--danger);
}

/* Details Section */
.details-section, .checks-section {
    margin-bottom: 32px;
}

.details-section h3, .checks-section h3 {
    font-family: var(--font-header);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 15px;
    font-weight: 500;
}

.detail-value.highlight {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 18px;
    color: #a5b4fc;
}

.detail-value.code {
    font-family: monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
    word-break: break-all;
    color: #93c5fd;
}

/* Checks List */
.checks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.check-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.check-title {
    font-size: 14px;
    font-weight: 600;
}

.check-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.check-status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.check-status-badge.passed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.check-status-badge.failed {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.check-status-badge.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Buttons */
.btn {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.actions-area {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: auto;
    padding-top: 40px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
}

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

@media (max-width: 600px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* ==========================================
   Telegram Web App & History Tab Additions
   ========================================== */

/* Tabs Navigation */
.tabs-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-header);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* History Header & List */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item-bank {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.history-item-file {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
}

.history-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.history-item-amount {
    font-weight: 700;
    font-family: var(--font-header);
    color: #a5b4fc;
    font-size: 16px;
}

.history-empty {
    text-align: center;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.005);
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.4;
}

.empty-sub {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 250px;
}

/* Telegram Web App Theme Adaptations */
body.tg-app {
    --bg-color: var(--tg-theme-secondary-bg-color, #080b11);
    --text-primary: var(--tg-theme-text-color, #f3f4f6);
    --text-secondary: var(--tg-theme-hint-color, #9ca3af);
    --card-bg: var(--tg-theme-bg-color, rgba(17, 25, 40, 0.75));
    --primary: var(--tg-theme-button-color, #4f46e5);
    --card-border: rgba(255, 255, 255, 0.05);
}

body.tg-app .card {
    background: var(--tg-theme-bg-color, rgba(17, 25, 40, 0.75));
    border-color: rgba(255, 255, 255, 0.05);
}

body.tg-app .detail-item, 
body.tg-app .check-card,
body.tg-app .history-item {
    background: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.015));
}

body.tg-app .btn-secondary {
    background-color: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.05));
    color: var(--tg-theme-button-color, #4f46e5);
}

/* ==========================================
   Profile & Referral Cards Styling
   ========================================== */
.profile-card, .limit-card {
    padding: 24px;
    animation: fadeIn 0.4s ease-out;
}

.profile-balance-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid var(--primary-glow);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.balance-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.balance-value {
    font-family: var(--font-header);
    font-size: 36px;
    font-weight: 700;
    color: var(--success);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.referral-box, .stats-box {
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
}

.referral-box h4, .stats-box h4 {
    font-family: var(--font-header);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.referral-box p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.referral-box ul {
    list-style: none;
    margin-bottom: 16px;
}

.referral-box ul li {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-left: 6px;
    border-left: 2px solid var(--primary);
}

.ref-link-container {
    display: flex;
    flex-direction: column;
}

.ref-link-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.ref-link-input-group {
    display: flex;
    gap: 8px;
}

.ref-link-input-group input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: monospace;
    outline: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-header);
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.buy-notice-box {
    background: rgba(79, 70, 229, 0.05);
    border: 1px dashed rgba(79, 70, 229, 0.25);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.buy-notice-box p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==========================================
   Out of Credits Card Styling
   ========================================== */
.limit-card {
    text-align: center;
    padding: 32px 24px;
}

.limit-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.limit-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

.limit-card h3 {
    font-family: var(--font-header);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.limit-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 300px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.limit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 250px;
}

.limit-actions .btn {
    width: 100%;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
