/* ============================================
   La Maestra Anna - AI Detector
   Professional, warm, teacher-oriented design
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green: #4CAF50;
    --green-light: #E8F5E9;
    --green-dark: #2E7D32;
    --brown: #5D4037;
    --warm: #FFF8E1;
    --orange: #FF9800;
    --red: #E53935;
    --blue: #1976D2;
    --text: #3E2723;
    --text-light: #795548;
    --bg: linear-gradient(160deg, #FAFAFA 0%, #F1F8E9 50%, #FFF8E1 100%);
    --white: #fff;
    --border: #E0E0E0;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* --- Header --- */
.anna-header {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.back-link {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light); text-decoration: none; border-radius: 10px;
    transition: all 0.3s;
}
.back-link:hover { background: var(--green-light); color: var(--green-dark); }
.back-link svg { width: 20px; height: 20px; }
.header-title { display: flex; align-items: center; gap: 10px; flex: 1; }
.header-avatar { flex-shrink: 0; }
.header-title h1 { font-size: 18px; font-weight: 900; color: var(--green-dark); line-height: 1.1; }
.header-sub { font-size: 11px; color: var(--text-light); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13px; color: var(--text-light); }
.btn-sm {
    font-family: inherit; font-size: 12px; font-weight: 700;
    padding: 5px 14px; border-radius: 20px; border: 2px solid var(--border);
    background: none; color: var(--text-light); text-decoration: none; cursor: pointer;
    transition: all 0.2s;
}
.btn-sm:hover { border-color: var(--green); color: var(--green); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: white; }

/* --- Main --- */
.anna-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* --- Mode Tabs --- */
.mode-tabs {
    display: flex; gap: 8px;
    margin-bottom: 20px;
}
.mode-tab {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 16px;
    border: 2.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-family: inherit; font-size: 15px; font-weight: 800;
    color: var(--text-light); cursor: pointer;
    transition: all 0.3s;
}
.mode-tab:hover { border-color: var(--green); color: var(--green); }
.mode-tab.active {
    border-color: var(--green);
    background: var(--green-light);
    color: var(--green-dark);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.15);
}
.mode-icon { font-size: 20px; }

/* --- Input Panel --- */
.input-panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    margin-bottom: 20px;
}

.anna-tip {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--warm);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-left: 4px solid var(--orange);
}
.anna-tip p {
    font-size: 14px; color: var(--text); line-height: 1.5; font-weight: 600;
}
.tip-avatar { flex-shrink: 0; }

.text-input {
    width: 100%;
    padding: 16px;
    border: 2.5px solid var(--border);
    border-radius: 14px;
    font-family: inherit; font-size: 15px;
    color: var(--text);
    resize: vertical;
    min-height: 160px;
    transition: border-color 0.3s, box-shadow 0.3s;
    line-height: 1.6;
}
.text-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}
.text-input::placeholder { color: #BDBDBD; }

.input-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; flex-wrap: wrap; gap: 10px;
}
.char-info { font-size: 12px; color: var(--text-light); }

.analyze-btn {
    display: flex; align-items: center; gap: 8px;
    font-family: inherit; font-size: 15px; font-weight: 800;
    padding: 12px 28px;
    border: none; border-radius: 14px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: white; cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}
.analyze-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(76, 175, 80, 0.35); }
.analyze-btn:disabled { background: #BDBDBD; box-shadow: none; cursor: wait; transform: none; }
.analyze-btn svg { width: 18px; height: 18px; }

/* --- Upload Zone --- */
.upload-zone {
    border: 3px dashed var(--border);
    border-radius: 14px;
    min-height: 200px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--green);
    background: rgba(76,175,80,0.03);
}
.upload-placeholder { text-align: center; padding: 30px; }
.upload-icon { font-size: 48px; display: block; margin-bottom: 8px; }
.upload-placeholder p { font-size: 15px; color: var(--text); }
.upload-hint { font-size: 12px; color: var(--text-light); }
.upload-preview { position: relative; width: 100%; }
.upload-preview img { width: 100%; max-height: 400px; object-fit: contain; display: block; }
.remove-preview {
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: white;
    border: none; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* --- Result Panel --- */
.result-panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.result-header h2 { font-size: 18px; font-weight: 900; }

/* Verdict bar */
.verdict-bar {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    background: #F5F5F5;
    margin-bottom: 20px;
    transition: all 0.4s;
}
.verdict-ai {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
    border: 2px solid #EF9A9A;
}
.verdict-human {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 2px solid #A5D6A7;
}
.verdict-unknown {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    border: 2px solid #FFE082;
}
.verdict-icon { font-size: 36px; }
.verdict-label { font-size: 20px; font-weight: 900; display: block; }
.verdict-conf { font-size: 13px; color: var(--text-light); font-weight: 600; }

/* Result body (markdown-like) */
.result-body {
    font-size: 14px; line-height: 1.7; color: var(--text);
}
.result-body p { margin-bottom: 12px; }
.result-body strong { color: var(--text); font-weight: 800; }
.result-body em { color: var(--green-dark); }
.result-body ul { padding-left: 20px; margin: 8px 0; }
.result-body li { margin-bottom: 6px; }
.analyzing {
    text-align: center; color: var(--green); font-weight: 700;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* --- History --- */
.history-section { margin-top: 10px; }
.history-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.history-header h2 { font-size: 18px; font-weight: 900; }
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--white);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--green); }
.history-type { font-size: 20px; flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-preview {
    font-size: 13px; font-weight: 600; display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-meta { font-size: 11px; color: var(--text-light); }
.history-verdict {
    font-size: 11px; font-weight: 800; padding: 3px 10px;
    border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.v-ai { background: #FFCDD2; color: #C62828; }
.v-human { background: #C8E6C9; color: #2E7D32; }
.v-unknown { background: #FFECB3; color: #F57F17; }

/* --- Login --- */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
}
.login-card {
    background: white; border-radius: 24px; padding: 48px 40px;
    text-align: center; box-shadow: 0 16px 50px rgba(76, 175, 80, 0.12);
    max-width: 400px; width: 100%;
    border: 3px solid rgba(76, 175, 80, 0.1);
}
.login-avatar { margin-bottom: 16px; }
.login-card h1 { font-size: 28px; font-weight: 900; color: var(--green-dark); margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--text-light); font-weight: 600; margin-bottom: 14px; }
.login-card > p { font-size: 15px; color: var(--text-light); margin-bottom: 24px; line-height: 1.5; }
.btn-login {
    display: inline-block; font-family: inherit; font-size: 16px; font-weight: 800;
    color: white; background: linear-gradient(135deg, var(--green), var(--green-dark));
    padding: 14px 36px; border-radius: 18px; text-decoration: none;
    transition: all 0.3s; box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}
.btn-login:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(76, 175, 80, 0.35); }

/* --- Footer --- */
.anna-footer {
    text-align: center; padding: 16px; font-size: 12px; color: var(--text-light);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .mode-tabs { flex-direction: column; }
    .anna-tip { flex-direction: column; align-items: center; text-align: center; }
    .input-footer { flex-direction: column; align-items: stretch; }
    .analyze-btn { justify-content: center; }
    .verdict-bar { flex-direction: column; text-align: center; }
}

/* --- Global Navigation Bar --- */
.global-nav {
    background: #1F313F;
    padding: 0;
    position: relative;
    z-index: 10500;
}
.gnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.gnav-brand {
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    padding: 8px 0;
    white-space: nowrap;
    opacity: 0.9;
}
.gnav-brand:hover { opacity: 1; }
.gnav-links {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gnav-links::-webkit-scrollbar { display: none; }
.gnav-link {
    font-family: "Nunito", sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 8px 12px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.gnav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.gnav-active { color: #fff; border-bottom-color: #25ADDA; }
@media (max-width: 600px) {
    .gnav-brand { display: none; }
    .gnav-inner { justify-content: center; }
    .gnav-link { font-size: 11px; padding: 8px 8px; }
}

