:root {
    /* Modern Clean Palette (Tailwind-inspired) */
    --primary: #4F46E5;       /* Indigo 600 */
    --primary-hover: #4338CA; /* Indigo 700 */
    --secondary: #10B981;     /* Emerald 500 */
    --accent: #F59E0B;        /* Amber 500 */
    
    --bg-body: #F3F4F6;       /* Cool Gray 100 */
    --bg-surface: #FFFFFF;
    
    --text-main: #111827;     /* Gray 900 */
    --text-muted: #6B7280;    /* Gray 500 */
    --border-color: #E5E7EB;  /* Gray 200 */

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --shadow-sm: 0 1px 2px 0 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);
    
    --nav-height: 70px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    padding-top: var(--nav-height);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em; /* Tight tracking for modern headings */
    margin-bottom: 0.75rem;
}

/* Navbar */
.navbar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 2px 0 rgba(79, 70, 229, 0.3);
}

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

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Cards */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Icons */
.icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: rgba(79, 70, 229, 0.1); /* Primary with opacity */
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group-text {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* Results & Status */
.status-text {
    font-weight: 500;
}

.result-card {
    background-color: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.source-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #E5E7EB;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.book-row {
    border-left: 4px solid transparent;
    padding-left: 0.75rem;
}

.book-remove-btn {
    color: #6B7280;
    font-size: 1.35rem;
    line-height: 1;
    min-width: 2rem;
    padding: 0 0.25rem;
    text-decoration: none;
}

.book-remove-btn:hover,
.book-remove-btn:focus {
    color: #DC2626;
    text-decoration: none;
}

.book-row-ump {
    background: #FFF7ED;
    border-left-color: #F97316;
}

.book-row-kz {
    background: #ECFDF5;
    border-left-color: #10B981;
}

.book-row-science {
    background: #EFF6FF;
    border-left-color: #2563EB;
}

.book-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    line-height: 1.2;
}

.book-tag {
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.38rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.tag-ump {
    background: #FED7AA;
    color: #9A3412;
}

.tag-kz {
    background: #A7F3D0;
    color: #065F46;
}

.tag-science {
    background: #BFDBFE;
    color: #1E3A8A;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #818CF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4338CA 100%);
}
