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

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: rgba(15, 23, 42, 0.08);
    
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.15);
    --secondary: #0d9488;
    --secondary-glow: rgba(13, 148, 136, 0.15);
    
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    
    --glass-blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(13, 148, 136, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.3);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header / Navbar */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    transition: var(--transition);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-heading);
}

.logo span {
    background: linear-gradient(135deg, var(--text-heading) 40%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-svg {
    transition: var(--transition);
}

.logo:hover .logo-svg {
    transform: rotate(5deg) scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.btn-outline:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: var(--text-muted);
    color: var(--text-heading);
}

/* Hero Section */
.hero-section {
    padding: 80px 0 60px 0;
    text-align: center;
    position: relative;
}

.hero-tagline {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--secondary);
    margin-bottom: 16px;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 30px;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.hero-title {
    font-size: 3.2rem;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(180deg, var(--text-heading) 60%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    max-width: 650px;
    margin: 0 auto 40px auto;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Search Bar (Landing & Browse) */
.search-container {
    max-width: 750px;
    margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-glow);
}

.search-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.search-input-group i {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.05rem;
    font-family: inherit;
}

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

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 60px 0;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(20, 184, 166, 0.1));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    font-size: 1.3rem;
    color: var(--secondary);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Document Cards */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.doc-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.doc-card:hover {
    transform: translateX(4px);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.doc-card:hover::before {
    opacity: 1;
}

.doc-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge-thesis { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-journal { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.3); }
.badge-proceeding { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-book { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

.doc-card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.doc-card-title a {
    color: var(--text-heading);
}

.doc-card-title a:hover {
    color: var(--secondary);
}

.doc-excerpt {
    color: var(--text-muted);
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.doc-stats {
    display: flex;
    gap: 16px;
}

.doc-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Browse Page Sidebar / Search Results */
.search-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 40px 0;
}

.filter-sidebar {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    height: fit-content;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 1rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-heading);
}

.form-select, .form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Auth Pages (Login & Register) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: 40px 0;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-heading);
}

.form-group input, .form-group select {
    width: 100%;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
}

.alert {
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #15803d;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

/* Document Detail Page */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    padding: 40px 0;
}

.detail-main {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    color: var(--text-heading);
}

.document-title-large {
    font-size: 2.2rem;
    line-height: 1.25;
    margin: 12px 0 20px 0;
}

.abstract-section {
    margin-top: 32px;
}

.abstract-section h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.abstract-text {
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

/* Cite Generator Tab Layout */
.cite-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    gap: 8px;
}

.cite-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.cite-tab-btn:hover {
    color: var(--text-heading);
}

.cite-tab-btn.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

.cite-box-wrapper {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--text-main);
    position: relative;
    min-height: 80px;
}

/* Footer */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-heading);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* Mobile Navigation Button & Overlay */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-heading);
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
    transition: var(--transition);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .detail-layout, .search-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 80px 24px 40px 24px;
        gap: 16px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links li a {
        display: block;
        width: 100%;
        padding: 12px 0;
        font-size: 1.05rem;
        border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    }
    
    .nav-links li a.btn-premium,
    .nav-links li a.btn-outline {
        border-bottom: none;
        text-align: center;
        margin-top: 10px;
        padding: 12px;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 1.15rem;
    }
    .logo img {
        height: 28px !important;
    }
}
