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

:root {
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 20px 30px -5px rgba(15, 23, 42, 0.12), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.portal-wrapper {
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Navigation / Top Header */
.portal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0369a1 100%);
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.portal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.header-brand {
    position: relative;
    z-index: 1;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #38bdf8;
    margin-bottom: 8px;
}

.header-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
}

.portal-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.portal-header p {
    color: #94a3b8;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.user-meta {
    text-align: left;
}

.user-meta .user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: block;
}

.user-meta .user-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: capitalize;
}

/* Nav Buttons */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-btn-logout {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.nav-btn-logout:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
}

/* Flash Alerts */
.flash-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.flash-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.flash-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.flash-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

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

/* Global Stats Bar */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.stat-box-info h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-box-info .stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-box-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon-blue { background: #eff6ff; color: #2563eb; }
.stat-icon-emerald { background: #ecfdf5; color: #10b981; }
.stat-icon-amber { background: #fffbeb; color: #f59e0b; }
.stat-icon-purple { background: #f5f3ff; color: #8b5cf6; }

/* Journals Grid */
.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.journals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.journal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.journal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    opacity: 0;
    transition: var(--transition);
}

.journal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

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

.journal-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.journal-code-tag {
    background: #0f172a;
    color: #38bdf8;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.journal-live-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    background: #ecfdf5;
    padding: 3px 8px;
    border-radius: 12px;
}

.journal-live-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
}

.journal-live-dot.dot-error {
    color: #ef4444;
    background: #fef2f2;
}

.journal-live-dot.dot-error::before {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.journal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.journal-url {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 20px;
}

.journal-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    margin-bottom: 18px;
}

.stat-item .stat-item-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.stat-item .stat-item-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-item .stat-item-val.unseen-count {
    color: #ef4444;
}

.journal-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.journal-card:hover .journal-card-footer {
    color: var(--primary-hover);
}

/* Tables */
.card-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-header-bar {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.table-header-bar h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.portal-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.portal-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}

.portal-table tbody tr {
    transition: var(--transition);
}

.portal-table tbody tr:hover {
    background-color: #f8fafc;
}

.portal-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }
.badge-emerald { background: #ecfdf5; color: #047857; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #475569; }

.badge-new {
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    display: inline-block;
}

.badge-seen {
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    color: #ffffff;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-outline {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 20px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Single Submission Grid */
.submission-review-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: start;
}

.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.card-panel h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.info-list-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 14px;
}

.info-list-item .info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-list-item .info-val {
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

.panel-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 20px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.panel-text-box {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
    max-height: 250px;
    overflow-y: auto;
}

.file-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.file-link-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(4px);
}

.file-link-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 13px;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    resize: vertical;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form select,
.inline-form input {
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Details Abstract */
details.abstract-accordion {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 13px;
}

details.abstract-accordion summary {
    font-weight: 700;
    cursor: pointer;
    color: var(--primary);
    outline: none;
}

details.abstract-accordion[open] summary {
    margin-bottom: 8px;
}

.abstract-inner {
    max-height: 140px;
    overflow-y: auto;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}

/* Auth / Login Page */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e293b 80%, #0369a1 100%);
    padding: 24px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.auth-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #ffffff;
    margin: 0 auto 16px;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.auth-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.auth-header p {
    font-size: 13px;
    color: #64748b;
}

.default-creds-hint {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 12px;
    color: #1e40af;
    margin-top: 24px;
    line-height: 1.5;
}

.default-creds-hint code {
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 992px) {
    .portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .submission-review-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .portal-wrapper {
        padding: 16px 12px;
    }
    .stats-strip {
        grid-template-columns: 1fr;
    }
    .journals-grid {
        grid-template-columns: 1fr;
    }
    .card-panel {
        padding: 20px 16px;
    }
}
