/* ============================================
   NOAMI Portal — Frontend Styles
   ============================================ */

:root {
    --noami-primary: #0a1628;
    --noami-secondary: #1a3a5c;
    --noami-accent: #00bfa6;
    --noami-accent-light: #00e6c8;
    --noami-text: #1e293b;
    --noami-text-light: #64748b;
    --noami-text-muted: #94a3b8;
    --noami-bg: #f0f4f8;
    --noami-card: #ffffff;
    --noami-border: #e2e8f0;
    --noami-success: #10b981;
    --noami-warning: #f59e0b;
    --noami-danger: #ef4444;
    --noami-info: #3b82f6;
    --noami-purple: #8b5cf6;
    --noami-radius: 12px;
    --noami-radius-sm: 8px;
    --noami-shadow: 0 4px 24px rgba(0,0,0,0.06);
    --noami-shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
    --noami-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --noami-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

/* ─── AUTH PAGES ───────────────────────────── */
.noami-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--noami-primary) 0%, var(--noami-secondary) 50%, #0d4a6b 100%);
    padding: 20px;
    font-family: var(--noami-font);
}

.noami-auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--noami-card);
    border-radius: 20px;
    box-shadow: var(--noami-shadow-lg);
    overflow: hidden;
    animation: noamiSlideUp 0.6s ease;
}

@keyframes noamiSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.noami-auth-header {
    background: linear-gradient(135deg, var(--noami-primary) 0%, var(--noami-accent) 100%);
    padding: 40px 40px 36px;
    text-align: center;
}

.noami-auth-header h1 {
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
}

.noami-auth-header p {
    margin: 8px 0 0;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.noami-auth-body {
    padding: 36px 40px 40px;
}

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

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

.noami-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.noami-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--noami-border);
    border-radius: var(--noami-radius-sm);
    font-family: var(--noami-font);
    font-size: 14px;
    color: var(--noami-text);
    transition: var(--noami-transition);
    background: #f8fafc;
}

.noami-input:focus {
    outline: none;
    border-color: var(--noami-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,191,166,0.1);
}

textarea.noami-input {
    min-height: 100px;
    resize: vertical;
}

select.noami-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.noami-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--noami-radius-sm);
    font-family: var(--noami-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--noami-transition);
    text-decoration: none;
    line-height: 1.4;
}

.noami-btn-primary {
    background: linear-gradient(135deg, var(--noami-accent) 0%, var(--noami-accent-light) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,191,166,0.3);
}
.noami-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,191,166,0.4);
}

.noami-btn-secondary {
    background: var(--noami-bg);
    color: var(--noami-text);
    border: 2px solid var(--noami-border);
}
.noami-btn-secondary:hover {
    background: var(--noami-border);
}

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

.noami-btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
}

.noami-btn-block {
    width: 100%;
}

.noami-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.noami-auth-footer {
    text-align: center;
    padding-top: 16px;
    font-size: 14px;
    color: var(--noami-text-light);
}
.noami-auth-footer a {
    color: var(--noami-accent);
    text-decoration: none;
    font-weight: 600;
}

.noami-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--noami-text-light);
}
.noami-checkbox input { accent-color: var(--noami-accent); }

/* ─── TOAST / ALERT ────────────────────────── */
.noami-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    padding: 16px 24px;
    border-radius: var(--noami-radius-sm);
    font-family: var(--noami-font);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    max-width: 400px;
    box-shadow: var(--noami-shadow-lg);
    animation: noamiToastIn 0.4s ease;
}

.noami-toast.success { background: var(--noami-success); }
.noami-toast.error { background: var(--noami-danger); }
.noami-toast.info { background: var(--noami-info); }

@keyframes noamiToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ─── DASHBOARD LAYOUT ─────────────────────── */
.noami-dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--noami-bg);
    font-family: var(--noami-font);
}

.noami-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--noami-primary) 0%, #0d2137 100%);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--noami-transition);
}

.noami-sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.noami-sidebar-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
}

.noami-sidebar-logo span {
    color: var(--noami-accent);
}

.noami-sidebar-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.noami-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.noami-nav-section {
    margin-bottom: 24px;
}

.noami-nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 0 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.noami-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--noami-transition);
    margin-bottom: 2px;
}

.noami-nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.noami-nav-item.active {
    background: linear-gradient(135deg, rgba(0,191,166,0.2) 0%, rgba(0,191,166,0.1) 100%);
    color: var(--noami-accent);
}

.noami-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.noami-nav-badge {
    margin-left: auto;
    background: var(--noami-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    min-width: 18px;
    text-align: center;
}

.noami-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.noami-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    transition: var(--noami-transition);
}
.noami-user-card:hover { background: rgba(255,255,255,0.06); }

.noami-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--noami-accent), var(--noami-info));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.noami-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.noami-user-info {
    flex: 1;
    min-width: 0;
}
.noami-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.noami-user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

/* ─── MAIN CONTENT ─────────────────────────── */
.noami-main {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    min-height: 100vh;
}

.noami-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.noami-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--noami-text);
    margin: 0;
}

.noami-page-subtitle {
    font-size: 14px;
    color: var(--noami-text-light);
    margin-top: 4px;
}

.noami-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ─── STAT CARDS ───────────────────────────── */
.noami-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.noami-stat-card {
    background: var(--noami-card);
    border-radius: var(--noami-radius);
    padding: 24px;
    box-shadow: var(--noami-shadow);
    transition: var(--noami-transition);
    border: 1px solid var(--noami-border);
}
.noami-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--noami-shadow-lg);
}

.noami-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.noami-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--noami-text);
    line-height: 1;
}

.noami-stat-label {
    font-size: 13px;
    color: var(--noami-text-light);
    margin-top: 4px;
    font-weight: 500;
}

/* ─── CARDS & TABLES ───────────────────────── */
.noami-card {
    background: var(--noami-card);
    border-radius: var(--noami-radius);
    box-shadow: var(--noami-shadow);
    border: 1px solid var(--noami-border);
    margin-bottom: 24px;
}

.noami-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--noami-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.noami-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--noami-text);
    margin: 0;
}

.noami-card-body {
    padding: 24px;
}

.noami-table {
    width: 100%;
    border-collapse: collapse;
}

.noami-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--noami-text-muted);
    background: var(--noami-bg);
    border-bottom: 1px solid var(--noami-border);
}

.noami-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--noami-text);
    border-bottom: 1px solid var(--noami-border);
}

.noami-table tr:last-child td { border-bottom: none; }
.noami-table tr:hover td { background: #f8fafc; }

/* ─── BADGE ────────────────────────────────── */
.noami-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ─── MODAL ────────────────────────────────── */
.noami-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: noamiFadeIn 0.2s ease;
}

@keyframes noamiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.noami-modal {
    background: var(--noami-card);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    animation: noamiSlideUp 0.3s ease;
}

.noami-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--noami-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.noami-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--noami-text);
    margin: 0;
}

.noami-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--noami-bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: var(--noami-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--noami-transition);
}
.noami-modal-close:hover { background: var(--noami-border); }

.noami-modal-body {
    padding: 28px;
}

.noami-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--noami-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ─── EMPTY STATE ──────────────────────────── */
.noami-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--noami-text-light);
}
.noami-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.noami-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--noami-text);
    margin-bottom: 8px;
}

/* ─── TAB CONTENT ──────────────────────────── */
.noami-tab-content {
    display: none;
    animation: noamiFadeIn 0.3s ease;
}
.noami-tab-content.active {
    display: block;
}

/* ─── LOADING SPINNER ──────────────────────── */
.noami-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.noami-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--noami-border);
    border-top-color: var(--noami-accent);
    border-radius: 50%;
    animation: noamiSpin 0.7s linear infinite;
}
@keyframes noamiSpin {
    to { transform: rotate(360deg); }
}

/* ─── NOTIFICATION BELL ────────────────────── */
.noami-notif-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--noami-border);
    background: var(--noami-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--noami-text-light);
    transition: var(--noami-transition);
}
.noami-notif-btn:hover { background: var(--noami-bg); }

.noami-notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--noami-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ─── CERTIFICATE VIEW ─────────────────────── */
.noami-certificate {
    background: #fff;
    border: 3px solid var(--noami-accent);
    border-radius: 16px;
    padding: 60px 48px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
.noami-certificate::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px solid var(--noami-border);
    border-radius: 12px;
    pointer-events: none;
}

.noami-cert-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--noami-primary);
    margin-bottom: 8px;
}

.noami-cert-org {
    font-size: 14px;
    color: var(--noami-text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 32px;
}

/* ─── VERIFY PAGE ──────────────────────────── */
.noami-verify-wrap {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    font-family: var(--noami-font);
}

.noami-verify-card {
    max-width: 500px;
    width: 100%;
    background: var(--noami-card);
    border-radius: var(--noami-radius);
    padding: 48px;
    box-shadow: var(--noami-shadow-lg);
    text-align: center;
}

.noami-verify-icon { font-size: 48px; margin-bottom: 16px; }

/* ─── RESPONSIVE ───────────────────────────── */
@media (max-width: 768px) {
    .noami-sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    .noami-sidebar.open { transform: translateX(0); }
    .noami-main { margin-left: 0; padding: 20px; }
    .noami-stats-grid { grid-template-columns: 1fr 1fr; }
    .noami-form-row { grid-template-columns: 1fr; }
    .noami-auth-body { padding: 28px 24px; }
    .noami-modal { max-width: 95%; }
}

@media (max-width: 480px) {
    .noami-stats-grid { grid-template-columns: 1fr; }
}

/* ─── JOURNAL PUBLIC ───────────────────────── */
.noami-journal-public {
    font-family: var(--noami-font);
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.noami-article-item {
    background: var(--noami-card);
    border-radius: var(--noami-radius);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--noami-border);
    transition: var(--noami-transition);
}
.noami-article-item:hover {
    box-shadow: var(--noami-shadow);
    transform: translateY(-2px);
}

.noami-article-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--noami-text);
    margin-bottom: 8px;
}

.noami-article-meta {
    font-size: 13px;
    color: var(--noami-text-light);
    margin-bottom: 12px;
}

.noami-article-abstract {
    font-size: 14px;
    color: var(--noami-text);
    line-height: 1.7;
}
