@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0284c7;
    --primary-light: #e0f2fe;
    --navbar-bg: #090e17; 
    --navbar-text: #94a3b8;
    --navbar-active: #ffffff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Category Colors */
    --color-rewriting: #8b5cf6;
    --color-rewriting-light: #ede9fe;
    --color-safety: #ef4444;
    --color-safety-light: #fee2e2;
    --color-transcription: #10b981;
    --color-transcription-light: #d1fae5;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); overflow-x: hidden; }
a { text-decoration: none; }

/* ---------------------------------
   Full Screen Loaders & Modals
--------------------------------- */
.page-loader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(248, 250, 252, 0.95); backdrop-filter: blur(10px);
    z-index: 9999; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.spinner {
    width: 80px; height: 80px; border: 6px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Assessment Modal Overlay */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px);
    z-index: 2000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
    width: 100%; max-width: 500px; background: var(--card-bg);
    border-radius: 16px; padding: 2.5rem; position: relative;
    transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-overlay.active .modal-content { transform: translateY(0); }

.modal-close { position: absolute; top: 1.5rem; right: 1.5rem; color: var(--text-muted); }
.modal-close:hover { color: var(--text-dark); }

.modal-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; margin: 0 auto; }
.modal-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.5rem 0; }
.modal-reward-box { background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; padding: 1.2rem; }
.reward-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }
.reward-row strong { font-size: 1.1rem; }

/* ---------------------------------
   Layout & Top Navigation
--------------------------------- */
.layout-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.top-navbar {
    position: sticky; top: 0; left: 0; width: 100%;
    background-color: var(--navbar-bg);
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 3rem; z-index: 50; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.navbar-left { display: flex; align-items: center; gap: 1rem; }
.brand-logo { width: 100px; height: 100px; object-fit: contain; }

.nav-menu { flex: 1; display: flex; justify-content: center; gap: 0.8rem; }
.nav-item {
    padding: 0.6rem 1rem; border-radius: 6px; cursor: pointer;
    color: var(--navbar-text); display: flex; align-items: center; gap: 8px; font-weight: 500;
    transition: 0.2s; font-size: 0.95rem;
}
.nav-item:hover { color: var(--navbar-active); background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--primary); color: white; }

.navbar-right { display: flex; align-items: center; gap: 1rem; }
.logout-btn { color: #ef4444; padding: 0.6rem; }
.logout-btn:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* ---------------------------------
   Main Content & UI Utilities
--------------------------------- */
.main-content { padding: 2rem; max-width: 1500px; margin: 0 auto; width: 100%;}
.workspace-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mt-base { margin-top: 1.5rem; }
.mb-base { margin-bottom: 1.5rem; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-dark { color: var(--text-dark); }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.bento-card { 
    background: var(--card-bg); padding: 1.5rem; border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}
.card-title { color: var(--text-dark); font-size: 1.25rem; margin-bottom: 0.25rem; line-height: 1.3;}
.card-subtitle { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5;}

/* Buttons & Inputs */
.btn { padding: 0.8rem 1.2rem; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; font-size: 0.95rem; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center;}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0369a1; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-dark); }
.btn-outline:hover { background: var(--bg-main); }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem;}
.btn-full { width: 100%; }

.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-dark); }
input { padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; width: 100%; outline: none; transition: 0.2s; font-family: inherit;}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light);}

/* ---------------------------------
   Assessment Filter Bar
--------------------------------- */
.filter-bar {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
    padding: 1rem 1.5rem;
}
.filter-group { display: flex; align-items: center; gap: 0.8rem; }
.filter-label { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;}
.filter-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 0.5rem 1rem;}
.filter-btn:hover { background: var(--bg-main); color: var(--text-dark); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.3);}

.custom-select {
    padding: 0.6rem 1rem; border: 1px solid var(--border); border-radius: 6px; 
    font-family: inherit; font-weight: 600; color: var(--text-dark); outline: none;
    cursor: pointer; background-color: white;
}
.custom-select:focus { border-color: var(--primary); }

/* ---------------------------------
   Assessment Cards
--------------------------------- */
.massive-scale { animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.project-card {
    display: flex; flex-direction: column; justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; overflow: hidden;
}
.project-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1); }

.project-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.project-icon {
    width: 55px; height: 55px; border-radius: 12px; display: flex; justify-content: center; align-items: center;
    font-size: 1.8rem; margin-bottom: 1rem;
}

.badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;}
.badge-loc { border: 1px solid var(--border); color: var(--text-muted); background: white; }
.badge-rewriting { background: var(--color-rewriting-light); color: var(--color-rewriting); border: 1px solid var(--color-rewriting); }
.badge-safety { background: var(--color-safety-light); color: var(--color-safety); border: 1px solid var(--color-safety); }
.badge-transcription { background: var(--color-transcription-light); color: var(--color-transcription); border: 1px solid var(--color-transcription); }

/* Apply project icon colors based on category */
.card-rewriting .project-icon { background: var(--color-rewriting-light); color: var(--color-rewriting); }
.card-safety .project-icon { background: var(--color-safety-light); color: var(--color-safety); }
.card-transcription .project-icon { background: var(--color-transcription-light); color: var(--color-transcription); }

.req-box {
    background: var(--bg-main); border-radius: 8px; padding: 1rem;
    border: 1px solid var(--border); margin: 1rem 0; font-size: 0.85rem;
}
.req-box strong { display: block; margin-bottom: 0.5rem; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.75rem;}
.desc-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.rate-tag { font-size: 1.25rem; font-weight: 700; color: var(--text-dark); }
.rate-tag span { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.pulse-animation { animation: gentlePulse 2s infinite ease-in-out; }
@keyframes gentlePulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---------------------------------
   Simulator Panel
--------------------------------- */
.simulator-panel {
    position: fixed; top: 0; right: -450px; width: 450px; height: 100vh;
    background: white; border-left: 1px solid var(--border); box-shadow: -20px 0 40px rgba(0,0,0,0.1);
    z-index: 1000; transition: right 0.3s ease; display: flex; flex-direction: column;
}
.simulator-panel.open { right: 0; }
.sim-header { background: var(--navbar-bg); color: white; padding: 1.5rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border);}
.sim-content { padding: 1.5rem; overflow-y: auto; }
.sim-section { color: var(--primary); margin-bottom: 1rem; margin-top: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;}
.grid-2-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem;}
.close-btn { background: none; border: none; color: white; cursor: pointer; font-size: 1.2rem; }
.alert-box { background: #d1fae5; color: #065f46; padding: 1rem; border-radius: 6px; font-size: 0.85rem; border: 1px solid #34d399; }

/* Responsive */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: flex-start; }
}