/* ===================================
   FWS Annotation App - Main Stylesheet
   =================================== */

/* CSS Variables */
:root {
    --primary: #537D96;
    --primary-hover: #426478;
    --primary-light: #f0f5f8;
    --primary-tint: #f0f5f8;
    --border-light: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-800: #1e293b;
    --pdf-bg: #f3f4f6;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --info: #3b82f6;
}

/* Base Reset */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-main);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 15px; }
h6 { font-size: 14px; }

/* Card Styles */
.card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    background: white;
    overflow: hidden;
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
}

.card-body {
    padding: 24px;
}

/* Metric Card (with hover effect) */
.metric-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Card Background Variants */
.card-bg-blue {
    background: linear-gradient(180deg, #f0f9ff 0%, white 100%);
}

.card-bg-purple {
    background: linear-gradient(180deg, #f5f3ff 0%, white 100%);
}

.card-bg-green {
    background: linear-gradient(180deg, #ecfdf5 0%, white 100%);
}

.card-bg-orange {
    background: linear-gradient(180deg, #fff7ed 0%, white 100%);
}

.card-bg-pink {
    background: linear-gradient(180deg, #fdf2f8 0%, white 100%);
}

.card-bg-cyan {
    background: linear-gradient(180deg, #ecfeff 0%, white 100%);
}

.card-bg-red {
    background: linear-gradient(180deg, #fef2f2 0%, white 100%);
}

.card-bg-indigo {
    background: linear-gradient(180deg, #eef2ff 0%, white 100%);
}

.card-bg-teal {
    background: linear-gradient(180deg, #f0fdfa 0%, white 100%);
}

.card-bg-gray {
    background: linear-gradient(180deg, #f8fafc 0%, white 100%);
}

.card-footer {
    background: white;
    border-top: 1px solid var(--border-light);
    padding: 16px 20px;
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 24px;
}

.stat-card-gradient-blue {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.stat-card-gradient-green {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.stat-card-gradient-purple {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.stat-card-gradient-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.stat-card-stat {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
}

/* Table Styles */
.table {
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 14px 20px;
}

.table td {
    padding: 14px 20px;
    vertical-align: middle;
}

.table-header {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-hover tbody tr {
    transition: background 0.2s;
}

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

/* Form Controls */
.form-control {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(83, 125, 150, 0.1);
    outline: none;
}

/* Readonly/Muted textarea */
.form-control[readonly],
textarea[readonly] {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

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

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

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

/* Badge Styles */
.badge {
    font-weight: 600;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
}

.badge-high {
    background-color: #dcfce7;
    color: #166534;
}

.badge-medium {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-low {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Radio Option (Custom) */
.radio-option {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--border-light);
    text-align: center;
}

.radio-option:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Progress Bar (for heatmap) */
.progress-bar-custom {
    height: 16px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-custom .progress {
    height: 100%;
    transition: width 0.3s ease;
}

/* Section Title */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .material-icons {
    font-size: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .material-icons {
    font-size: 48px;
    opacity: 0.5;
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary);
}

.bg-primary-custom {
    background-color: var(--primary);
}

.bg-primary-light {
    background-color: rgba(83, 125, 150, 0.1);
}

.border-light {
    border-color: var(--border-light) !important;
}

/* Main Content Container */
.main-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 40px;
}

/* Page Header */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.page-header p {
    color: #64748b;
    font-size: 15px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--primary);
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    background-color: var(--primary-light);
}

/* Filter Button */
.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border-light);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f8fafc;
}

.filter-btn.active {
    background: white !important;
    color: var(--primary) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border-color: var(--border-light);
}

/* Search Input */
.search-input {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 10px 14px 10px 40px;
    font-size: 14px;
    transition: all 0.2s;
    width: 250px;
}

.search-input:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--primary);
    outline: none;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #94a3b8;
    pointer-events: none;
}

/* Page Button (Pagination) */
.page-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: white;
    border: 1px solid var(--border-light);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #f8fafc;
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Stat Box */
.stat-box {
    background: white;
    padding: 16px 28px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-box-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-box-value {
    font-size: 24px;
    font-weight: 900;
    color: #1e293b;
}

/* Workspace Styles */
.workspace-main {
    height: calc(100vh - 64px);
    display: flex;
    overflow: hidden;
}

.workspace-sidebar {
    width: 250px;
    min-width: 250px;
    background: white;
    border-right: 1px solid var(--border-light);
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.workspace-sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: none;
}

.workspace-pdf-section {
    flex: 7;
    background: var(--pdf-bg);
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    min-width: 0;
}

.workspace-annotation-section {
    flex: 5;
    background: var(--primary-tint);
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
    min-width: 300px;
    max-width: 50%;
}

@media (max-width: 992px) {
    .workspace-main {
        flex-wrap: wrap;
        height: auto;
        min-height: calc(100vh - 64px);
    }
    .workspace-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        min-width: unset;
    }
    .workspace-sidebar.collapsed {
        display: none;
    }
    .workspace-pdf-section, .workspace-annotation-section {
        width: 100% !important;
        max-width: 100% !important;
        flex: unset;
        height: auto;
        min-height: 400px;
    }
}

.queue-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    font-size: 11px;
    border-left: 4px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-item:hover {
    background: #f8fafc;
}

.queue-item.active {
    background: var(--primary-tint);
    border-left-color: var(--primary);
}

.pdf-content {
    background: white;
    padding: 48px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    min-height: 800px;
    max-width: 100%;
    margin: 24px auto;
    flex: 1;
}

.ann-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.ann-card.active {
    border: 2px solid var(--primary);
    background: var(--primary-tint);
}

.scrollbar::-webkit-scrollbar {
    width: 4px;
}

.scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* ===================================
   LOGIN PAGE STYLES
   =================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f6f7f7;
    font-family: 'Inter', sans-serif;
}

.login-container {
    width: 100%;
    max-width: 28rem;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header-icon {
    width: 64px;
    height: 64px;
    background: rgba(83, 126, 151, 0.1);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-header-icon .material-icons {
    font-size: 32px;
    color: var(--primary);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
    margin: 0;
}

.login-header p {
    color: rgba(83, 126, 151, 0.7);
    font-size: 14px;
    max-width: 16rem;
    margin: 8px auto 0;
}

/* Card */
.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(83, 126, 151, 0.1);
    border: 1px solid rgba(83, 126, 151, 0.1);
    overflow: hidden;
}

.login-card-inner {
    padding: 40px 32px;
}

/* Welcome */
.login-welcome {
    margin-bottom: 32px;
}

.login-welcome h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px;
}

.login-welcome p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Form Group */
.login-group {
    margin-bottom: 24px;
}

.login-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.login-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.login-group-header label {
    margin-bottom: 0;
}

/* Input */
.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.login-input-icon .material-icons {
    font-size: 18px;
    color: #9ca3af;
}

.login-input-wrap input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #1f2937;
    transition: all 0.2s;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(83, 126, 151, 0.1);
}

.login-input-wrap input::placeholder {
    color: #9ca3af;
}

/* Toggle */
.login-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #9ca3af;
}

.login-toggle:hover {
    color: #6b7280;
}

.login-toggle .material-icons {
    font-size: 18px;
}

/* Forgot Link */
.login-forgot {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.login-forgot:hover {
    color: rgba(83, 126, 151, 0.8);
}

/* Remember */
.login-remember {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary);
}

.login-remember label {
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    margin: 0;
}

/* Submit */
.login-submit {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-submit:hover {
    background: rgba(83, 126, 151, 0.9);
    box-shadow: 0 4px 12px rgba(83, 126, 151, 0.3);
}

/* Error */
.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    margin-top: 24px;
    font-size: 13px;
    border-radius: 8px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.login-error .material-icons {
    font-size: 18px;
}

/* Contact */
.login-contact {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.login-contact p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.login-contact a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.login-contact a:hover {
    text-decoration: underline;
}

/* Footer */
.login-footer {
    margin-top: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.login-version {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card-inner {
        padding: 32px 24px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
}
