/* ADAM Security Butler - Dark Theme */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-input: #1a1a25;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --text-muted: #555;
    --accent: #4a9eff;
    --accent-dim: #2a5a9f;
    --danger: #ff4a4a;
    --warning: #ffaa4a;
    --success: #4aff6a;
    --border: #2a2a3a;
}

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

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container */
.container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
}

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

.header h1 {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.header .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Button */
.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-dim);
    border: none;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--accent);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status */
.status {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
}

.status.warning {
    color: var(--warning);
}

.status.danger {
    color: var(--danger);
}

.status.success {
    color: var(--success);
}

/* Attempts counter */
.attempts {
    text-align: center;
    margin-top: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.attempts strong {
    color: var(--warning);
}

/* Chat UI Styles */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

.chat-header {
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.mode-indicator {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-indicator.normal {
    background: var(--success);
    color: var(--bg-dark);
}

.mode-indicator.suspicious {
    background: var(--warning);
    color: var(--bg-dark);
}

.mode-indicator.under-attack {
    background: var(--danger);
    color: white;
}

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background: var(--accent-dim);
    border-bottom-right-radius: 4px;
}

.message.butler {
    align-self: flex-start;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message.system {
    align-self: center;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Chat Input */
.chat-input-container {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-input-container button {
    padding: 12px 20px;
    background: var(--accent-dim);
    border: none;
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input-container button:hover {
    background: var(--accent);
}

.chat-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading dots */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Honeypot - invisible to humans, visible to bots */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Character count */
.char-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    align-self: center;
    min-width: 45px;
    text-align: right;
}

/* Bot detected message */
.message.system.bot-detected {
    color: var(--danger);
    font-weight: 500;
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 24px;
    }

    .message {
        max-width: 90%;
    }

    .chat-input-container {
        padding: 12px 16px;
        gap: 8px;
    }

    .chat-input-container input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .chat-input-container button {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .char-count {
        display: none; /* Hide on small screens */
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .chat-input-container button {
        min-height: 44px;
        min-width: 44px;
    }

    .chat-input-container input {
        min-height: 44px;
    }
}

/* ============================================
   LOGIN PAGE STYLES - HackMeIfYouCan.win
   ============================================ */

/* Animated Background */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(90deg, rgba(74, 158, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(74, 158, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
    opacity: 0.3;
}

/* Login Page Layout */
.login-page {
    background: radial-gradient(ellipse at center, #0d1520 0%, #0a0a0f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

/* Hero / Title */
.hero {
    text-align: center;
    margin-bottom: 24px;
}

.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    position: relative;
    text-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff4a4a;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #4aff6a;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    5% { clip: rect(70px, 9999px, 71px, 0); }
    10% { clip: rect(29px, 9999px, 24px, 0); }
    15% { clip: rect(69px, 9999px, 64px, 0); }
    20% { clip: rect(14px, 9999px, 1px, 0); }
    25% { clip: rect(22px, 9999px, 99px, 0); }
    30% { clip: rect(72px, 9999px, 56px, 0); }
    35% { clip: rect(91px, 9999px, 29px, 0); }
    40% { clip: rect(0px, 9999px, 45px, 0); }
    45% { clip: rect(67px, 9999px, 85px, 0); }
    50% { clip: rect(43px, 9999px, 21px, 0); }
    55% { clip: rect(98px, 9999px, 13px, 0); }
    60% { clip: rect(55px, 9999px, 69px, 0); }
    65% { clip: rect(2px, 9999px, 48px, 0); }
    70% { clip: rect(76px, 9999px, 91px, 0); }
    75% { clip: rect(38px, 9999px, 17px, 0); }
    80% { clip: rect(83px, 9999px, 62px, 0); }
    85% { clip: rect(11px, 9999px, 88px, 0); }
    90% { clip: rect(59px, 9999px, 35px, 0); }
    95% { clip: rect(26px, 9999px, 79px, 0); }
    100% { clip: rect(44px, 9999px, 52px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 97px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

.tagline {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 300;
    margin-top: -8px;
    letter-spacing: 2px;
}

/* Bounty Section */
.bounty-section {
    margin-bottom: 24px;
}

.bounty-card {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(74, 255, 106, 0.05) 100%);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bounty-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(74, 158, 255, 0.1) 50%,
        transparent 55%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.bounty-label {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.bounty-amount {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(74, 255, 106, 0.5);
    position: relative;
    z-index: 1;
}

.bounty-amount .currency {
    font-size: 1.5rem;
    vertical-align: top;
    color: var(--success);
}

.bounty-amount .value {
    color: var(--success);
}

.bounty-amount .usd {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

.bounty-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* AI Section */
.ai-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.ai-icon {
    position: relative;
    width: 48px;
    height: 48px;
}

.ai-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

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

.ai-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

.ai-info {
    text-align: left;
}

.ai-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Login Card */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.lock-icon {
    color: var(--accent);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-primary);
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent-dim) 0%, #1a4070 100%);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.4);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Attempts Display */
.attempts-display {
    margin-top: 20px;
}

.attempts-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.attempts-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s, background 0.3s;
    border-radius: 2px;
}

.attempts-fill.warning {
    background: var(--warning);
}

.attempts-fill.critical {
    background: var(--danger);
}

.attempts-text {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.attempts-text strong {
    color: var(--text-primary);
}

/* Status Message */
.status-message {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8rem;
    display: none;
    padding: 12px;
    border-radius: 6px;
}

.status-message.warning {
    color: var(--warning);
    background: rgba(255, 170, 74, 0.1);
    border: 1px solid rgba(255, 170, 74, 0.2);
}

.status-message.danger {
    color: var(--danger);
    background: rgba(255, 74, 74, 0.1);
    border: 1px solid rgba(255, 74, 74, 0.2);
}

/* Security Footer - Terminal Style */
.security-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

a.badge {
    text-decoration: none;
    transition: all 0.15s;
}

a.badge:hover {
    background: rgba(74, 255, 106, 0.05);
}

a.badge:hover .badge-arrow {
    color: #fff;
}

a.badge:hover .badge-name {
    text-decoration: underline;
}

.badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-left: 2px solid var(--border);
    line-height: 1.8;
}

.badge-arrow {
    color: var(--text-muted);
    font-weight: bold;
    font-size: 1rem;
}

.badge-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.badge-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.4;
}

.badge-name {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* Link Colors - Bright and visible */
a.dragonshield .badge-name {
    color: #00d4ff;
}

a.dragonfire .badge-name {
    color: #ff8c42;
}

a.servers .badge-name {
    color: #42ff90;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

/* Animations */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.redirecting .login-container {
    animation: fadeOut 2s forwards;
}

.redirecting .cyber-grid {
    animation: gridIntensify 2s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.95); filter: blur(10px); }
}

@keyframes gridIntensify {
    0% { opacity: 1; }
    100% { opacity: 0.5; background-size: 25px 25px; }
}

/* Login Page Mobile */
@media (max-width: 520px) {
    .login-page {
        padding: 16px;
    }

    .glitch {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .bounty-card {
        padding: 20px 16px;
    }

    .bounty-amount {
        font-size: 2.2rem;
    }

    .bounty-amount .currency {
        font-size: 1.2rem;
    }

    .ai-badge {
        padding: 12px 16px;
    }

    .login-card {
        padding: 24px;
    }

    .security-footer {
        gap: 2px;
    }

    .badge {
        padding: 6px 12px;
    }
}

/* Login Page Touch */
@media (pointer: coarse) {
    .login-btn {
        min-height: 52px;
    }

    .login-card .form-group input {
        min-height: 48px;
        font-size: 16px;
    }
}
