/* ============================================================
   NR Scholar Personal Center — Shared Styles
   Brand: Purple #4A3A6B, Gold #D4AF37
   Background: linear-gradient #FFFFFF → #FEFCF8
   ============================================================ */

/* ---- Layout ---- */
.scholar-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
    gap: 32px;
    min-height: calc(100vh - 200px);
}

/* ---- Sidebar ---- */
.scholar-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding-top: 32px;
}

.scholar-sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #4A3A6B;
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 16px;
}

.scholar-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scholar-sidebar-nav li {
    margin-bottom: 2px;
}

.scholar-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: 2px solid transparent;
    /* hand-drawn border */
    border-radius: 14px 10px 13px 11px;
}

.scholar-sidebar-nav a:hover {
    background: rgba(74, 58, 107, 0.06);
    color: #4A3A6B;
}

.scholar-sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(74, 58, 107, 0.1) 0%, rgba(212, 175, 55, 0.08) 100%);
    color: #4A3A6B;
    font-weight: 600;
    border-color: #D4AF37;
    border-width: 2px;
}

/* Hand-drawn sidebar icons (pure CSS) */
.sidebar-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    position: relative;
    flex-shrink: 0;
}

.sidebar-icon::before {
    content: '';
    position: absolute;
    border: 2px solid currentColor;
    border-radius: 3px 4px 2px 3px;
}

/* Dashboard icon */
.sidebar-icon-dashboard::before {
    width: 14px; height: 14px; top: 2px; left: 2px;
    box-shadow: 2px -2px 0 0 currentColor, 6px 4px 0 0 currentColor;
    border: none;
}

/* Profile icon */
.sidebar-icon-profile::before {
    width: 8px; height: 8px; border-radius: 50%;
    top: 1px; left: 5px;
}
.sidebar-icon-profile::after {
    content: '';
    position: absolute;
    width: 14px; height: 7px; border-radius: 7px 7px 0 0;
    border: 2px solid currentColor; border-bottom: none;
    top: 9px; left: 2px;
}

/* Publications icon */
.sidebar-icon-pub::before {
    width: 10px; height: 14px; top: 2px; left: 4px;
    border: 2px solid currentColor; border-radius: 0;
}
.sidebar-icon-pub::after {
    content: '';
    position: absolute;
    width: 6px; height: 1px; background: currentColor;
    top: 6px; left: 6px;
    box-shadow: 0 3px 0 currentColor, 0 6px 0 currentColor;
}

/* Metrics icon */
.sidebar-icon-metrics::before {
    width: 14px; height: 14px; top: 2px; left: 2px;
    border: 2px solid currentColor; border-radius: 0;
}
.sidebar-icon-metrics::after {
    content: '';
    position: absolute;
    width: 3px; height: 6px; background: currentColor;
    top: 8px; left: 4px;
    box-shadow: 4px -2px 0 currentColor, 8px 0px 0 currentColor;
    border: none;
}

/* Collections icon */
.sidebar-icon-collections::before {
    width: 12px; height: 12px; top: 3px; left: 3px;
    border: 2px solid currentColor;
}
.sidebar-icon-collections::after {
    content: '';
    position: absolute;
    width: 4px; height: 4px; background: currentColor;
    top: 5px; left: 7px;
}

/* History icon */
.sidebar-icon-history::before {
    width: 14px; height: 14px; border-radius: 50%;
    top: 2px; left: 2px;
    border: 2px solid currentColor;
}
.sidebar-icon-history::after {
    content: '';
    position: absolute;
    width: 2px; height: 5px; background: currentColor;
    top: 4px; left: 8px;
    transform: rotate(-30deg);
}

/* ---- Main Content ---- */
.scholar-main {
    flex: 1;
    min-width: 0;
    padding-top: 32px;
}

.scholar-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #4A3A6B;
    margin-bottom: 6px;
}

.scholar-page-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 28px;
}

/* ---- Stat Cards ---- */
.scholar-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.scholar-stat-card {
    background: #fff;
    border: 2px solid #E8E0F0;
    border-radius: 16px 12px 15px 13px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.scholar-stat-card:hover {
    border-color: #D4AF37;
    box-shadow: 0 4px 16px rgba(74, 58, 107, 0.08);
}

.scholar-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #4A3A6B;
    line-height: 1.2;
}

.scholar-stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.scholar-stat-icon {
    font-size: 20px;
    margin-bottom: 6px;
    color: #D4AF37;
}

/* ---- Cards ---- */
.scholar-card {
    background: #fff;
    border: 2px solid #E8E0F0;
    border-radius: 16px 12px 15px 13px;
    padding: 24px;
    margin-bottom: 24px;
}

.scholar-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0ecf5;
}

.scholar-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #4A3A6B;
    margin: 0;
}

/* ---- Activity List ---- */
.scholar-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scholar-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f0fa;
}

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

.scholar-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4AF37;
    flex-shrink: 0;
}

.scholar-activity-text {
    flex: 1;
    font-size: 14px;
    color: #444;
}

.scholar-activity-time {
    font-size: 12px;
    color: #aaa;
    flex-shrink: 0;
}

/* ---- Form ---- */
.scholar-form {
    max-width: 560px;
}

.scholar-form-group {
    margin-bottom: 16px;
}

.scholar-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4A3A6B;
    margin-bottom: 6px;
}

.scholar-form-group input,
.scholar-form-group textarea,
.scholar-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E8E0F0;
    border-radius: 10px 8px 9px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fefcff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.scholar-form-group input:focus,
.scholar-form-group textarea:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.scholar-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.scholar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px 8px 9px 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.scholar-btn-primary {
    background: linear-gradient(135deg, #4A3A6B 0%, #6B5B8B 100%);
    color: #fff;
    border-color: #4A3A6B;
}

.scholar-btn-primary:hover {
    background: linear-gradient(135deg, #5B4B7B 0%, #7B6B9B 100%);
    box-shadow: 0 4px 12px rgba(74, 58, 107, 0.25);
}

.scholar-btn-outline {
    background: transparent;
    color: #4A3A6B;
    border-color: #4A3A6B;
}

.scholar-btn-outline:hover {
    background: rgba(74, 58, 107, 0.05);
}

.scholar-btn-gold {
    background: linear-gradient(135deg, #D4AF37 0%, #E8C84A 100%);
    color: #4A3A6B;
    border-color: #D4AF37;
}

.scholar-btn-gold:hover {
    background: linear-gradient(135deg, #E8C84A 0%, #F0D860 100%);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.scholar-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.scholar-btn-danger {
    background: transparent;
    color: #c0392b;
    border-color: #e74c3c;
}

.scholar-btn-danger:hover {
    background: rgba(231, 76, 60, 0.05);
}

.scholar-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ---- Table ---- */
.scholar-table {
    width: 100%;
    border-collapse: collapse;
}

.scholar-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #4A3A6B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #E8E0F0;
}

.scholar-table td {
    padding: 12px;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid #f5f0fa;
}

.scholar-table tr:hover td {
    background: rgba(74, 58, 107, 0.02);
}

.scholar-table .title-col {
    font-weight: 600;
    color: #333;
}

.scholar-table .cite-col {
    color: #D4AF37;
    font-weight: 600;
}

/* ---- Filter Bar ---- */
.scholar-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.scholar-filter-bar select {
    padding: 8px 12px;
    border: 2px solid #E8E0F0;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    background: #fefcff;
    font-family: inherit;
}

/* ---- Tabs ---- */
.scholar-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #E8E0F0;
    padding-bottom: 0;
}

.scholar-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: inherit;
}

.scholar-tab:hover {
    color: #4A3A6B;
}

.scholar-tab.active {
    color: #4A3A6B;
    border-bottom-color: #D4AF37;
}

/* ---- Metrics ---- */
.scholar-metric-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.scholar-metric-card {
    background: linear-gradient(135deg, #4A3A6B 0%, #6B5B8B 100%);
    color: #fff;
    border-radius: 16px 12px 15px 13px;
    padding: 28px 24px;
    text-align: center;
    border: 2px solid #D4AF37;
}

.scholar-metric-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.1;
}

.scholar-metric-label {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Bar Chart (CSS only) */
.scholar-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 20px 0 0;
}

.scholar-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.scholar-bar {
    width: 100%;
    max-width: 48px;
    background: linear-gradient(to top, #D4AF37, #4A3A6B);
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 4px;
}

.scholar-bar-label {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
}

.scholar-bar-value {
    font-size: 11px;
    color: #4A3A6B;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Source Distribution */
.scholar-source-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scholar-source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f0fa;
}

.scholar-source-name {
    width: 160px;
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

.scholar-source-bar-bg {
    flex: 1;
    height: 8px;
    background: #f0ecf5;
    border-radius: 4px;
    overflow: hidden;
}

.scholar-source-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #D4AF37, #4A3A6B);
    border-radius: 4px;
    transition: width 0.6s;
}

.scholar-source-count {
    font-size: 14px;
    font-weight: 700;
    color: #4A3A6B;
    width: 40px;
    text-align: right;
}

/* ---- Empty State ---- */
.scholar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 14px;
}

/* ---- Alert ---- */
.scholar-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.scholar-alert-success {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .scholar-layout {
        flex-direction: column;
        padding: 0 16px 40px;
        gap: 16px;
    }
    .scholar-sidebar {
        width: 100%;
        padding-top: 20px;
    }
    .scholar-sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .scholar-sidebar-nav li {
        margin-bottom: 0;
    }
    .scholar-sidebar-nav a {
        padding: 8px 12px;
        font-size: 12px;
    }
    .scholar-metric-cards {
        grid-template-columns: 1fr;
    }
    .scholar-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}