/* Design system lifted from dspqr's card-generation app (same company, same look) */

:root {
    --griehser-red: #C8102E;
    --griehser-dark-red: #A00D25;
    --griehser-black: #1a1a1a;
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* Navbar */
.navbar-custom {
    background: white;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    z-index: 1000;
}

.navbar-brand img {
    height: 45px;
}

.btn-logout {
    background: var(--griehser-red);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
}

.btn-logout:hover {
    background: var(--griehser-dark-red);
}

/* Cards */
.glass-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

/* Login page */
.login-container {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    padding-top: 5rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 16, 46, 0.1);
    border-radius: 25px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.logo-container {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container img {
    height: 60px;
    margin-bottom: 1rem;
}

.login-title {
    text-align: center;
    color: var(--griehser-black);
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.form-label {
    font-weight: 600;
    color: var(--griehser-black);
    margin-bottom: 0.5rem;
}

.form-control {
    padding: 0.9rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--griehser-red);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
    outline: none;
}

.btn-login {
    background: linear-gradient(135deg, var(--griehser-red), var(--griehser-dark-red));
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--griehser-red);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Upload area */
.upload-area {
    border: 3px dashed #dee2e6;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--griehser-red);
    background: rgba(200, 16, 46, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--griehser-red);
    margin-bottom: 1rem;
}

.file-selected {
    background: #d4edda;
    border: 2px solid #28a745;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}
.file-selected.show { display: flex; }

.btn-upload {
    background: linear-gradient(135deg, var(--griehser-red), var(--griehser-dark-red));
    border: none;
    color: white;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
    display: none;
}
.btn-upload.show { display: inline-block; }

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
}

/* Error messages */
.error-message {
    background: #fee;
    border: 2px solid var(--griehser-red);
    color: var(--griehser-dark-red);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}
.error-message.show { display: flex; }

/* Toast variant of error-message, fixed to viewport corner (upload errors) */
.error-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    max-width: 320px;
}

/* Utility classes replacing inline style="" attributes (CSP style-src-attr has no
   'unsafe-inline' and never should - these exist so nothing needs one). */
.heading-black { color: var(--griehser-black); }
.heading-bold { font-weight: 700; }
.glass-card-title { font-weight: 600; margin-bottom: 1.5rem; }
.hidden-file-input { display: none; }

/* Results table (Location -> Danger -> Action), icons lifted from HSE-iD's
   TranscriptAITreeView (composeResources/drawable/location|danger|actions.png) */
.result-icon {
    width: 60px;
    height: 60px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.results-table {
    background: white;
}

.results-table th {
    background: #f8f9fa;
    color: var(--griehser-black);
}

/* results.html tabs */
#result-tabs .nav-link {
    color: var(--griehser-black);
    font-weight: 500;
}

#result-tabs .nav-link.active {
    color: var(--griehser-red);
    border-color: #dee2e6 #dee2e6 white;
    font-weight: 600;
}

.tab-content-area {
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 15px 15px;
    padding: 2rem;
}

.ocr-text {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    max-height: 70vh;
    overflow-y: auto;
}

.ocr-text h1, .ocr-text h2, .ocr-text h3 {
    color: var(--griehser-black);
    margin-top: 1.5rem;
}

.ocr-text table {
    width: 100%;
    margin-bottom: 1rem;
}

.ocr-text table, .ocr-text th, .ocr-text td {
    border: 1px solid #dee2e6;
    border-collapse: collapse;
    padding: 0.5rem;
}

.ocr-text-raw {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin: 0;
}
