:root {
    /* Modern Color Palette - HSL based for better harmony */
    --primary: hsl(217, 91%, 60%);
    --primary-hover: hsl(217, 91%, 50%);
    --success: hsl(142, 71%, 45%);
    --error: hsl(0, 84%, 60%);
    --warning: hsl(38, 92%, 50%);
    --info: hsl(25, 95%, 53%);
    
    --bg-main: #f0f4f8;
    --text-main: hsl(222, 47%, 11%);
    --text-muted: hsl(215, 16%, 47%);
    --white: #ffffff;
    
    /* Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(12px);
    
    /* Spacing & Borders */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container-width: 1100px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(-45deg, #e2e8f0, #f8fafc, #eef2f6, #cbd5e1);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    padding: 1rem 0 3rem;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Header - Modern Glass Effect */
.header-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    box-shadow: var(--glass-shadow);
    position: sticky;
    top: 1rem;
    z-index: 1000;
    animation: fadeInUp 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.shield-icon {
    color: var(--success);
    width: clamp(32px, 5vw, 42px);
    height: clamp(32px, 5vw, 42px);
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.3));
}

h1 {
    font-size: clamp(1.25rem, 4vw, 1.875rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* Search Bar - Premium Interaction */
.search-section {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.search-bar {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-muted);
    margin-left: 0.75rem;
}

#urlInput {
    flex: 1;
    border: none;
    padding: 0.875rem 0.5rem;
    font-size: 1rem;
    outline: none;
    color: var(--text-dark);
    background: transparent;
}

#scanBtn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: var(--transition);
    white-space: nowrap;
}

#scanBtn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

#scanBtn:active {
    transform: scale(0.98);
}

/* Results Grid - Responsive Stacking */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    align-items: start;
}

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid #eef2f6;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    animation: fadeInUp 0.6s ease-out both;
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Prediction Result Component */
.result-card {
    grid-column: 1 / -1;
    background: linear-gradient(to right, var(--white), #fbfcfd);
}

.result-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2.5rem;
}

.status-info {
    flex: 1;
    min-width: 200px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 900;
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.status-badge i {
    width: 48px;
    height: 48px;
}

.status-badge.safe { 
    color: var(--success); 
    text-shadow: 0 0 24px rgba(34, 197, 94, 0.4);
}
.status-badge.safe i {
    filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.5));
}
.status-badge.phishing { 
    color: var(--error); 
    text-shadow: 0 0 24px rgba(239, 68, 68, 0.4);
}
.status-badge.phishing i {
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.5));
}

.risk-score {
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    display: inline-block;
}

.risk-score .label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.risk-score .value {
    font-weight: 800;
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

.analysis-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    border-left: 4px solid var(--primary);
    padding: 0.5rem 0 0.5rem 1.25rem;
    background: rgba(59, 130, 246, 0.03);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Divider for horizontal result layout */
.result-content::after {
    content: '';
    grid-column: 2;
    grid-row: 1;
    width: 1px;
    height: 100%;
    background: #eef2f6;
}

/* Custom Responsive Gauge */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.gauge {
    width: 220px;
    position: relative;
}

.gauge__body {
    width: 100%;
    height: 0;
    padding-bottom: 50%;
    background: #f1f5f9;
    position: relative;
    border-top-left-radius: 110px;
    border-top-right-radius: 110px;
    overflow: hidden;
}

.gauge__fill {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0.75turn at 50% 100%, #22c55e 0deg, #eab308 90deg, #ef4444 180deg);
    transform-origin: center top;
    transition: transform 1.5s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.gauge__cover {
    width: 82%;
    height: 164%;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 25%;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

/* Reasons List Items */
.reasons-list {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.reasons-list li {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.reasons-list li i {
    flex-shrink: 0;
    margin-top: 2px;
}

.reasons-list li.phishing-reason {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fee2e2;
}

.reasons-list li.safe-reason {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #dcfce7;
}

/* Modern Indicators List */
.indicators-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.indicator-item {
    gap: 0.625rem;
}

.indicator-labels {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.indicator-value {
    color: var(--primary);
}

.progress-container {
    height: 8px;
    background: #f1f5f9;
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    animation: shimmy 2s infinite;
}

@keyframes shimmy {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.green { background: linear-gradient(90deg, #4ade80, #22c55e); }
.progress-bar.yellow { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress-bar.orange { background: linear-gradient(90deg, #fb923c, #f97316); }
.progress-bar.red { background: linear-gradient(90deg, #f87171, #ef4444); }

/* API Status Items */
.api-status-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.api-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid transparent;
    transition: var(--transition);
}

.api-status-item:hover {
    border-color: #e2e8f0;
    background: #ffffff;
}

/* API Status Items - Refined for Uniformity */
.api-status-list {
    display: grid;
    gap: 0.75rem;
}

.api-status-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1.5px solid #eef2f6;
    transition: var(--transition);
    min-height: 64px; /* Uniform height */
}

.api-status-item:hover {
    border-color: var(--primary);
    background: var(--white);
    transform: translateX(4px);
}

.api-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.api-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.api-provider {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 110px; /* Consistently sized badge area */
    justify-content: flex-end;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* API Status States */
.api-status.waiting .badge { background: #f1f5f9; color: #64748b; }
.api-status.clean .badge { background: #dcfce7; color: #15803d; }
.api-status.suspicious .badge { background: #fee2e2; color: #b91c1c; }
.api-status.processing .badge { background: #e0f2fe; color: #0369a1; }

.api-status i {
    width: 16px;
    height: 16px;
}

.spin {
    animation: rotate 2s linear infinite;
}

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

/* Disclaimer Fix */
.disclaimer-card {
    background: rgba(251, 191, 36, 0.1) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 rgba(251, 191, 36, 0.05);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.disclaimer-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}

.disclaimer-header .warn-icon {
    color: var(--warning);
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

/* Footer - Premium Minimalist */
.footer-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 2rem 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.footer-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Animasi Scan Laser */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 0 20px 5px rgba(59, 130, 246, 0.6);
    animation: scanLaser 2s ease-in-out infinite;
    z-index: 10000;
}

@keyframes scanLaser {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e2e8f0;
    border-top-color: var(--primary);
    border-right-color: var(--success);
    border-radius: 50%;
    margin-bottom: 2rem;
    animation: rotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loading-overlay p {
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
    animation: pulse 1.5s infinite;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 960px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 0.5rem 0 2rem;
    }
    
    .container {
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .header-card {
        top: 0.5rem;
        padding: 0.875rem 1.25rem;
    }
    
    .search-bar {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    #urlInput {
        width: 100%;
        text-align: center;
        padding: 0.5rem;
    }
    
    #scanBtn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .result-content {
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .result-content::after {
        display: none;
    }
    
    .status-badge {
        justify-content: center;
    }
    
    .analysis-text {
        border-left: none;
        border-top: 3px solid #e2e8f0;
        padding-left: 0;
        padding-top: 1rem;
        max-width: none;
    }
    
    .gauge {
        width: 180px;
    }
}
