/* ====================================
   E-Print Repository Digital - Style Sheet
   ==================================== */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    color: var(--text);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.2s;
}
a:hover {
    color: var(--primary-dark);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
.btn-block {
    width: 100%;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}
.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #16a34a;
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover {
    background: #d97706;
}
.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover {
    background: #475569;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
select.form-control {
    height: 42px;
}
.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: currentColor;
    opacity: 0.7;
}
.alert-close:hover {
    opacity: 1;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table thead {
    background: var(--light);
    border-bottom: 2px solid var(--border);
}
.table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
}
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:hover {
    background: var(--light);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-submitted { background: #fed7aa; color: #9a3412; }
.status-under_review { background: #bae6fd; color: #075985; }
.status-published { background: #bbf7d0; color: #166534; }
.status-rejected { background: #fecaca; color: #991b1b; }
.status-draft { background: #e2e8f0; color: #475569; }
.status-active { background: #bbf7d0; color: #166534; }
.status-inactive { background: #e2e8f0; color: #475569; }

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.pagination .disabled {
    background: #f1f5f9;
    color: var(--gray);
    pointer-events: none;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.card-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Navbar (public) */
.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.navbar-brand i {
    font-size: 1.75rem;
}
.navbar-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1.5rem;
}
.navbar-menu a {
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 12px;
}
.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary);
}
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* Dropdown */
.dropdown {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    list-style: none;
    padding: 0.5rem 0;
    z-index: 1000;
}
.dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu li {
    width: 100%;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.875rem;
}
.dropdown-menu a:hover {
    background: var(--light);
}
.dropdown-menu .divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}
.badge {
    background: var(--danger);
    color: white;
    border-radius: 9999px;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Footer (public) */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}
.footer-about p {
    color: #cbd5e1;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.social-links {
    display: flex;
    gap: 0.5rem;
}
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #334155;
    color: #cbd5e1;
    transition: all 0.2s;
}
.social-links a:hover {
    background: var(--primary);
    color: white;
}
.footer-links h4,
.footer-contact h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1rem;
}
.footer-links ul,
.footer-contact ul {
    list-style: none;
}
.footer-links li,
.footer-contact li {
    margin-bottom: 0.5rem;
}
.footer-links a {
    color: #cbd5e1;
    font-size: 0.875rem;
}
.footer-links a:hover {
    color: white;
}
.footer-contact li {
    display: flex;
    gap: 0.5rem;
    color: #cbd5e1;
    font-size: 0.875rem;
}
.footer-contact i {
    color: var(--primary);
    width: 20px;
}
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 260px;
    background: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}
.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--light);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-info i {
    font-size: 2rem;
    color: var(--secondary);
}
.user-info strong {
    display: block;
    font-size: 0.875rem;
}
.user-info small {
    color: var(--text-light);
    font-size: 0.75rem;
}
.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}
.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.sidebar-nav .nav-item a i {
    width: 20px;
    color: var(--text-light);
}
.sidebar-nav .nav-item a:hover {
    background: var(--light);
    color: var(--primary);
}
.sidebar-nav .nav-item a:hover i {
    color: var(--primary);
}
.sidebar-nav .nav-item.active a {
    background: var(--primary);
    color: white;
}
.sidebar-nav .nav-item.active a i {
    color: white;
}
.admin-main {
    flex: 1;
    margin-left: 260px;
    background: #f1f5f9;
    min-height: 100vh;
}
.admin-topbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.admin-content {
    padding: 2rem 1.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 6rem 0;
    text-align: center;
}
.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}
.search-box {
    max-width: 600px;
    margin: 0 auto 3rem;
}
.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    outline: none;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}
.hero-stats div span:first-child {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}
.hero-stats div span:last-child {
    font-size: 1rem;
    opacity: 0.8;
}

/* Cards Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.doc-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.doc-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}
.doc-card h3 a {
    color: var(--text);
}
.doc-card h3 a:hover {
    color: var(--primary);
}
.doc-card p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.doc-card .meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--gray);
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}
.stat-icon.primary { background: var(--primary); }
.stat-icon.success { background: var(--success); }
.stat-icon.warning { background: var(--warning); }
.stat-icon.danger { background: var(--danger); }
.stat-icon.info { background: var(--info); }
.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-content p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.875rem;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    padding: 1.5rem;
}
.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}
.auth-header p {
    color: var(--text-light);
}
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-light);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* Simple grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}
.col {
    flex: 1 0 0%;
    padding: 0 0.75rem;
}
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Responsive */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
    .navbar-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        gap: 0;
    }
    .navbar-menu.show {
        display: flex;
    }
    .navbar-menu li {
        width: 100%;
    }
    .navbar-menu a {
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
        text-align: center;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        display: none;
        background: #f8fafc;
    }
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .admin-sidebar.active {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: block;
    }
    .admin-main {
        margin-left: 0;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .hero-stats {
        gap: 1.5rem;
    }
    .row {
        flex-direction: column;
    }
    .col-4, .col-6, .col-8 {
        max-width: 100%;
        flex: 0 0 100%;
    }
}