/* ========================================
   Protecte MailArmor - Link Scanner
   Premium UI Design System
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary: #1B3DA3;
    --primary-dark: #112749;
    --primary-light: #3B5DC9;
    --accent: #0066FF;

    /* Background Colors */
    --bg-dark: #0a0e1a;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-secondary: #F5F7FA;

    /* Status Colors */
    --success: #10B981;
    --success-light: #34D399;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --danger: #EF4444;
    --danger-light: #F87171;
    --info: #3B82F6;
    --info-light: #60A5FA;

    /* Text Colors */
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Border & Others */
    --border: #E5E7EB;
    --border-light: #F3F4F6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(27, 61, 163, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, #0a0e1a 0%, #111827 100%);
    z-index: -2;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
}

/* Container */
.container {
    width: 100%;
    max-width: 480px;
    position: relative;
}

/* Main Card */
.card {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow:
        var(--shadow-2xl),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: cardEntrance 0.6s ease-out;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 144px;
    height: 44px;
    border-radius: 12px;
    /* background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    /* box-shadow: 0 4px 12px rgba(27, 61, 163, 0.3); */
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Content Area */
.content {
    padding: 40px 32px;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* State Container */
.state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    animation: stateEnter 0.4s ease-out;
}

.state-container.hidden {
    display: none;
}

@keyframes stateEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Scanner Animation */
.scanner-animation {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: scannerPulse 2s ease-out infinite;
}

.ring-1 {
    width: 60px;
    height: 60px;
    animation-delay: 0s;
}

.ring-2 {
    width: 90px;
    height: 90px;
    animation-delay: 0.4s;
}

.ring-3 {
    width: 120px;
    height: 120px;
    animation-delay: 0.8s;
}

@keyframes scannerPulse {
    0% {
        opacity: 0.8;
        transform: scale(0.8);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

.scanner-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
    animation: scannerRotate 3s linear infinite;
}

.scanner-icon svg {
    width: 28px;
    height: 28px;
}

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

/* Progress Bar */
.progress-container {
    width: 100%;
    max-width: 280px;
    margin-top: 8px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 3px;
    animation: progressIndeterminate 1.5s ease-in-out infinite;
}

@keyframes progressIndeterminate {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 60%; }
    100% { transform: translateX(400%); width: 30%; }
}

.progress-text {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Status Icons */
.status-icon {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon svg {
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1;
}

.status-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.4;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

/* Status Variants */
.status-safe {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--success);
}

.status-safe .status-glow {
    /* background: var(--success); */
}

.status-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: var(--warning);
    animation: warningShake 0.5s ease-in-out;
}

.status-warning .status-glow {
    /* background: var(--warning); */
}

@keyframes warningShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.status-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: var(--danger);
    animation: dangerPulse 0.6s ease-out;
}

.status-danger .status-glow {
    /* background: var(--danger); */
}

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

.status-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--info);
}

.status-info .status-glow {
    /* background: var(--info); */
}

.status-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: var(--danger);
}

.status-error .status-glow {
    /* background: var(--danger); */
}

/* Checkmark Particles */
.checkmark-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.checkmark-particles span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    opacity: 0;
    animation: particleExplode 0.6s ease-out forwards;
}

.checkmark-particles span:nth-child(1) { top: 10%; left: 50%; animation-delay: 0.1s; }
.checkmark-particles span:nth-child(2) { top: 25%; right: 10%; animation-delay: 0.15s; }
.checkmark-particles span:nth-child(3) { bottom: 25%; right: 10%; animation-delay: 0.2s; }
.checkmark-particles span:nth-child(4) { bottom: 10%; left: 50%; animation-delay: 0.25s; }
.checkmark-particles span:nth-child(5) { bottom: 25%; left: 10%; animation-delay: 0.3s; }
.checkmark-particles span:nth-child(6) { top: 25%; left: 10%; animation-delay: 0.35s; }

@keyframes particleExplode {
    0% { transform: scale(0) translate(0, 0); opacity: 1; }
    100% { transform: scale(1) translate(var(--tx, 20px), var(--ty, -20px)); opacity: 0; }
}

.checkmark-particles span:nth-child(1) { --tx: 0; --ty: -30px; }
.checkmark-particles span:nth-child(2) { --tx: 25px; --ty: -15px; }
.checkmark-particles span:nth-child(3) { --tx: 25px; --ty: 15px; }
.checkmark-particles span:nth-child(4) { --tx: 0; --ty: 30px; }
.checkmark-particles span:nth-child(5) { --tx: -25px; --ty: 15px; }
.checkmark-particles span:nth-child(6) { --tx: -25px; --ty: -15px; }

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge svg {
    width: 14px;
    height: 14px;
}

.status-badge.safe {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* State Title & Message */
.state-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.state-message {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 340px;
    line-height: 1.6;
}

/* Redirect Box */
.redirect-box {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.redirect-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.redirect-header svg {
    width: 14px;
    height: 14px;
}

.redirect-url {
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
    word-break: break-all;
    margin-bottom: 12px;
}

.redirect-progress {
    height: 4px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.redirect-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    animation: redirectProgress 2s ease-out forwards;
}

@keyframes redirectProgress {
    from { width: 0; }
    to { width: 100%; }
}

/* Warning Details Box */
.warning-details-box {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 16px;
}

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

.detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 14px;
    color: var(--warning);
    word-break: break-all;
    font-weight: 500;
}

/* Decision Prompt */
.decision-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 8px;
}

.decision-prompt svg {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
}

/* Threat Info Box */
.threat-info-box {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    text-align: left;
}

.threat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    flex-shrink: 0;
}

.threat-icon svg {
    width: 20px;
    height: 20px;
}

.threat-details strong {
    display: block;
    font-size: 14px;
    color: var(--danger);
    margin-bottom: 4px;
}

.threat-details p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Info Box */
.info-box {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    text-align: left;
}

.info-box svg {
    width: 20px;
    height: 20px;
    color: var(--info);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn:focus {
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.4);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(27, 61, 163, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 61, 163, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Footer */
.footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.8) 100%);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-content svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.footer-content strong {
    color: var(--text-secondary);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .container {
        max-width: 100%;
    }

    .card {
        border-radius: 20px;
    }

    .header {
        padding: 16px 20px;
    }

    .content {
        padding: 32px 24px;
        min-height: 340px;
    }

    .state-title {
        font-size: 20px;
    }

    .state-message {
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .button-group .btn {
        width: 100%;
    }
}

/* ========================================
   Scrollbar & Selection
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

::selection {
    background: rgba(27, 61, 163, 0.2);
}

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