﻿/* Base styles */
body {
    visibility: hidden;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Light mode */
body.light-mode {
    background-color: white;
    color: black;
}

/* Dark mode */
body.dark-mode {
    background-color: #1e1e1e;
    color: white;
}

/* Error message styling */
#error-message {
    color: red;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

/* Visible error message */
#error-message.visible {
    display: block;
    opacity: 1;
}

/* Theme-aware text colors */
body.light-mode .theme-text-primary {
    color: #1a1a1a;
}

body.dark-mode .theme-text-primary {
    color: #e0e0e0;
}

body.light-mode .theme-text-secondary {
    color: #555;
}

body.dark-mode .theme-text-secondary {
    color: #aaa;
}

/* Theme-aware input styling */
body.light-mode .theme-input {
    background-color: inherit;
    color: inherit;
    border: 1px solid #ccc;
}

body.dark-mode .theme-input {
    background-color: #2a2a2a;
    border-color: #555;
    color: white;
}

/* Theme-aware button */
body.light-mode .theme-button {
    background-color: black;
    color: white;
}

body.dark-mode .theme-button {
    background-color: #444;
    color: white;
}

/* Theme-aware checkbox */
body.light-mode .theme-checkbox {
    accent-color: #2563eb; /* blue-600 */
    cursor: pointer;
}

body.dark-mode .theme-checkbox {
    accent-color: #60a5fa; /* blue-400 */
    cursor: pointer;
    background-color: #2a2a2a;
    border-color: #555;
}

/* Custom thin scrollbar */
#search-results::-webkit-scrollbar {
    width: 6px;
}

#search-results::-webkit-scrollbar-track {
    background: transparent;
}

#search-results::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.6); /* Tailwind gray-400 */
    border-radius: 9999px;
}

#search-results::-webkit-scrollbar-thumb:hover {
    background-color: rgba(107, 114, 128, 0.8); /* Tailwind gray-500 */
}

/* Firefox support */
#search-results {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.6) transparent;
}

#btnUpload {
    cursor: pointer;
}

#btnJobSearch {
    cursor: pointer;
}

#btnLogout {
    cursor: pointer;
}

.btn-clear-blue {
    color: #2563eb; /* Tailwind's blue-600 */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-clear-blue:hover {
    color: #1d4ed8; /* Tailwind's blue-700 */
    cursor: pointer;
}

@keyframes pulse-text-red {
    0% {
        color: #dc2626; /* Tailwind red-600 */
        transform: scale(1);
        text-shadow: none;
    }

    30% {
        color: #7f1d1d; /* Tailwind red-900 */
        transform: scale(1.05);
    }

    100% {
        color: #dc2626;
        transform: scale(1);
        text-shadow: none;
    }
}

.pulse-text-red {
    animation: pulse-text-red 0.6s ease-out;
}

/* Theme-aware spinner */
.theme-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

body.light-mode .theme-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #1a1a1a;
}

body.dark-mode .theme-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: #e0e0e0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success message */
body.light-mode .theme-success {
    background-color: #d1fae5; /* green-100 */
    color: #065f46; /* green-800 */
    border-color: #a7f3d0; /* green-200 */
}

body.dark-mode .theme-success {
    background-color: #064e3b;
    color: #d1fae5;
    border-color: #065f46;
}

/* Error message */
body.light-mode .theme-error {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
    border-color: #fecaca; /* red-200 */
}

body.dark-mode .theme-error {
    background-color: #7f1d1d;
    color: #fee2e2;
    border-color: #991b1b;
}

/* Summary panel appearance */
body.light-mode #summary-panel {
    background-color: #f9fafb; /* Tailwind gray-50 */
    color: #1f2937; /* Tailwind gray-800 */
    border-color: #e5e7eb; /* Tailwind gray-200 */
}

body.dark-mode #summary-panel {
    background-color: #292929;
    color: #f9fafb;
    border-color: #374151;
}

/* Short title: max 2 lines with ellipsis */
.short-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.2em;
    max-height: 2.4em;
}

.title-block {
    padding-right: 75px; /* Adjust based on badge width */
}

/* Status badge */
body.light-mode .status-badge,
body.dark-mode .status-badge {
    background-color: #93c5fd;
    color: #333;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    width: 65px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search result card appearance */
body.light-mode .search-card {
    background-color: #f9fafb; /* Tailwind gray-50 */
    color: #1f2937; /* Tailwind gray-800 */
    border-color: #e5e7eb; /* Tailwind gray-200 */
}

body.dark-mode .search-card {
    background-color: #292929;
    color: #f9fafb;
    border-color: #374151;
}

/* Selected case highlight */
body.light-mode .theme-selected {
    background-color: #f0f9ff; /* Tailwind sky-50 */
    border-color: #7dd3fc; /* Tailwind sky-300 */
}

body.dark-mode .theme-selected {
    background-color: #1f2937;
    border-color: #60a5fa;
}

body.light-mode .btn-clear-blue {
    color: #2563eb; /* Tailwind blue-600 */
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

body.light-mode .btn-clear-blue:hover {
    color: #1d4ed8; /* Tailwind blue-700 */
}

body.dark-mode .btn-clear-blue {
    color: #93c5fd; /* Tailwind blue-300 */
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

body.dark-mode .btn-clear-blue:hover {
    color: #bfdbfe; /* Tailwind blue-200 */
}
