/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Bright & Cool Palette */
    --primary: #0284c7; /* Sky 600 */
    --primary-hover: #0369a1; /* Sky 700 */
    --secondary: #06b6d4; /* Cyan 500 */
    --accent: #38bdf8; /* Sky 400 */
    
    /* Light Theme Colors */
    --bg-color: #f0f9ff; /* Sky 50 */
    --surface: rgba(255, 255, 255, 0.7);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --border-color: rgba(2, 132, 199, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    
    /* Effects */
    --shadow-soft: 0 10px 40px -10px rgba(2, 132, 199, 0.15);
    --shadow-strong: 0 20px 50px -12px rgba(2, 132, 199, 0.25);
    --glow: 0 0 25px rgba(56, 189, 248, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    /* Soft mesh gradient background for cool/icy feel */
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 90% 40%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
}

/* Animated Floating Shapes (Ice/Water colors) */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.7;
    animation: float 20s infinite ease-in-out alternate;
}
.shape-1 {
    top: -5%; left: -5%; width: 45vw; height: 45vw; 
    background: radial-gradient(circle, rgba(125, 211, 252, 0.5) 0%, rgba(125, 211, 252, 0) 70%);
    animation-delay: 0s;
}
.shape-2 {
    bottom: -10%; right: -5%; width: 40vw; height: 40vw; 
    background: radial-gradient(circle, rgba(165, 243, 252, 0.5) 0%, rgba(165, 243, 252, 0) 70%);
    animation-delay: -5s;
}
.shape-3 {
    top: 40%; left: 30%; width: 30vw; height: 30vw; 
    background: radial-gradient(circle, rgba(191, 219, 254, 0.4) 0%, rgba(191, 219, 254, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -40px) scale(1.05); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.logo .highlight {
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 5s infinite alternate;
}

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

.admin-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-link:hover {
    background: #fff;
    color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(2, 132, 199, 0.15);
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out;
    padding: 0 1rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    color: #0f172a;
}

.text-gradient {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.5;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.search-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2.5rem;
    width: 100%;
    box-shadow: var(--shadow-strong), inset 0 2px 0 rgba(255,255,255,0.8);
    animation: scaleIn 0.8s ease-out;
    position: relative;
    overflow: visible;
    z-index: 50;
}

/* Toggles */
.direction-toggle {
    display: flex;
    background: rgba(241, 245, 249, 0.7);
    border-radius: 16px;
    padding: 0.4rem;
    margin-bottom: 2rem;
    gap: 0.5rem;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn span {
    font-size: 1.2rem;
    opacity: 0.6;
    transition: transform 0.3s;
}

.toggle-btn:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.5);
}

.toggle-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
    border: 1px solid var(--glass-border);
}

.toggle-btn.active span {
    transform: scale(1.2);
    opacity: 1;
}

/* Search Box */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    width: 26px;
    height: 26px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.3s;
}

.search-input {
    width: 100%;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.25rem 3.5rem 1.25rem 3.5rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-input-container:focus-within .search-icon {
    color: var(--primary);
}

.search-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15), var(--shadow-soft);
    transform: translateY(-2px);
}

.clear-btn {
    position: absolute;
    right: 1.2rem;
    background: #f1f5f9;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: scale(1.1);
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    z-index: 10;
    box-shadow: var(--shadow-strong);
    animation: fadeIn 0.2s ease-out;
}

.autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background: #f8fafc;
    padding-left: 2rem;
}

.ac-source {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ac-translation {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Results */
.results-container {
    margin-top: 2rem;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid var(--primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.result-item::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(2, 132, 199, 0.03));
    transform: skewX(-20deg);
}

.result-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.result-source {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.result-translation {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.no-results {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}

.info-text {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: fadeIn 1s ease-out 0.5s both;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Overrides (For all devices) */
@media (max-width: 768px) {
    .app-container { padding: 1rem; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .search-card { padding: 1.5rem; border-radius: 20px; }
    .logo { font-size: 1.3rem; }
    
    .direction-toggle { margin-bottom: 1.5rem; flex-direction: column; }
    .toggle-btn { padding: 0.75rem; font-size: 0.95rem; }
    
    .search-input { font-size: 1.1rem; padding: 1rem 2.5rem 1rem 3rem; border-radius: 16px; }
    .search-icon { width: 22px; height: 22px; left: 1rem; }
    .clear-btn { right: 0.8rem; width: 28px; height: 28px; }
    
    .autocomplete-item { padding: 0.8rem 1rem; }
    .ac-source { font-size: 1rem; }
    
    .result-item { padding: 1.2rem; margin-bottom: 0.8rem; }
    .result-source { font-size: 1.3rem; }
    .result-translation { font-size: 1rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.8rem; }
    .search-card { padding: 1.25rem; }
    .app-header { flex-direction: column; gap: 1rem; }
    .admin-link { width: 100%; text-align: center; }
}
