/* ===================================================================== */
/* CORE CSS — Layout, UI, System
/* ===================================================================== */

/* ===================================================================== */
/* 1. ROOT & GLOBAL SYSTEM
/* ===================================================================== */

:root {
    --primary-color: #B71C1C; 
    --primary-hover: #991B1B;
    --secondary-color: #FFCDD2;
    --accent-blue: #1e3a8a;
    --background-color: #F8F9FA;
    --text-color: #212529;
    --text-muted: #6C757D;
    --border-color: #DEE2E6;
    --card-bg: #ffffff;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.08);
    --font-latin: 'Poppins', sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { scroll-behavior: smooth; margin: 0; padding: 0; }

body {
    font-family: var(--font-latin);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ===================================================================== */
/* HERO MINI
/* ===================================================================== */

.hero-mini {
    background: linear-gradient(135deg, hsla(224, 64%, 33%, 1) 0%, hsla(221, 83%, 53%, 1) 50%, hsla(224, 64%, 33%, 1) 100%);
    color: white;
    padding: 4rem 1rem 5rem 1rem;
    margin-bottom: -3rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-mini h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero-mini p {
    opacity: 0.9;
    font-size: 1.15rem;
    max-width: 640px;
    margin: 0 auto;
}

/* ===================================================================== */
/* GRID & LAYOUT
/* ===================================================================== */

.content-wrapper { position: relative; z-index: 2; padding-bottom: 4rem; }

.translator-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); 
    gap: 30px;
    width: 100%;
    align-items: start;
}

.card, 
.translator-card, 
.control-deck, 
.content-hub-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: visible;
}

/* ===================================================================== */
/* NAVBAR STICKY
/* ===================================================================== */

.content-navbar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 60px;
    z-index: 80;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    overflow-x: auto;
}

/* ===================================================================== */
/* INPUT / OUTPUT SYSTEM
/* ===================================================================== */

textarea,
.output-box {
    width: 100%;
    height: 250px;
    padding: 1.2rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1.6;
    background: #fff;
    transition: all 0.2s ease;
    resize: vertical;
}

textarea:focus,
.output-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--secondary-color);
}

/* ===================================================================== */
/* BUTTON SYSTEM
/* ===================================================================== */

.btn-cohesive {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    gap: 10px;
    font-size: 14px;
    font-family: var(--font-latin);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-cohesive:hover {
    border-color: #ced4da;
    background-color: #e9ecef;
    transform: translateY(-2px);
}

/* ===================================================================== */
/* TOAST ANIMATION
/* ===================================================================== */

.smart-toast {
    position: fixed;
    z-index: 9999;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    padding: 15px;
    opacity: 0;
    transform: translateY(calc(100% + 20px));
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.smart-toast.visible {
    opacity: 1;
    transform: translateX(0);
}

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

/* ===================================================================== */
/* MODAL SYSTEM
/* ===================================================================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===================================================================== */
/* GLOSSARY GRID
/* ===================================================================== */

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.glossary-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}