/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Variables */
:root {
    /* Brand Colors - SPEAK Gold Theme */
    --color-brand-gold: #D4AF37;
    --color-brand-bronze: #B8956A;
    --color-brand-dark-bronze: #8B6F47;
    --color-brand-bright-gold: #F4D03F;

    /* UI Colors */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-danger: #dc2626;
    --color-danger-dark: #b91c1c;
    --color-success: #16a34a;
    --color-warning: #ca8a04;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Cream Background */
    --color-bg-cream: #f5f0e6;
    --color-bg-cream-dark: #e8e0d0;
    --color-bg-cream-darker: #d9d0c0;

    /* Fonts */
    --font-brand: 'Volkhov', serif;
    --font-heading: 'Noto Serif', serif;
    --font-body: 'Noto Sans', sans-serif;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--color-bg-cream) 0%, var(--color-bg-cream-dark) 100%);
    background-attachment: fixed;
    color: var(--color-gray-900);
    line-height: 1.5;
}

/* App Layout */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--color-gray-200);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible;
    position: relative;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    position: relative;
    min-width: 180px;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-title {
    font-family: 'Noto Sans', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-gray-600);
    letter-spacing: 0.3px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.header-logo-link:hover {
    opacity: 0.8;
}

.header-logo-link:hover .logo-brand {
    text-decoration: none;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 72px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    position: absolute;
    top: -6px;
    left: 0;
    z-index: 100;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.logo {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 0.5px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-left: 40px;
    line-height: 1;
}

.logo-brand {
    font-family: 'Volkhov', Georgia, serif;
    font-weight: 700;
    color: var(--color-brand-dark-bronze);
}

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

.header-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--color-gray-300);
    margin: 0 4px;
}

/* Download Dropdown */
.download-dropdown {
    position: relative;
}

.download-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.download-menu.open {
    display: block;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-gray-700);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.download-option:hover {
}

.download-option:first-child {
    border-radius: 8px 8px 0 0;
}

.download-option:last-child {
    border-radius: 0 0 8px 8px;
}

.download-option svg {
    color: var(--color-gray-500);
    flex-shrink: 0;
}

.download-option:hover svg {
    color: var(--color-primary);
}

.btn-config {
    text-decoration: none;
}

.btn-config svg {
    flex-shrink: 0;
}

.badge {
    background: var(--color-danger);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

/* Buttons */
.btn {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}

.btn-secondary:hover:not(:disabled) {
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--color-danger-dark);
}

.btn-icon {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-500);
}

.btn-icon:hover {
    color: var(--color-gray-700);
}

/* Main Content */
.main {
    flex: 1;
    padding: 16px 24px;
}

/* Column Header Sort/Filter */
.col-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.col-title {
    flex-shrink: 0;
}

.col-icons {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.6;
    transition: opacity 0.15s;
}

th:hover .col-icons {
    opacity: 1;
}

.col-sort-btn,
.col-filter-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-gray-600);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.col-filter-btn svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
}

.col-sort-btn svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex-shrink: 0;
}

.col-sort-btn:hover,
.col-filter-btn:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

/* Sort icon states */
.col-sort-btn .sort-icon {
    display: none;
}

.col-sort-btn .sort-none {
    display: block;
    opacity: 0.4;
}

.col-sort-btn[data-sort="asc"] .sort-none,
.col-sort-btn[data-sort="desc"] .sort-none {
    display: none;
}

.col-sort-btn[data-sort="asc"] .sort-asc {
    display: block;
    color: var(--color-primary);
}

.col-sort-btn[data-sort="desc"] .sort-desc {
    display: block;
    color: var(--color-primary);
}

/* Active filter indicator */
.col-filter-btn.active {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.1);
}

.col-filter-btn.active svg {
    fill: var(--color-primary);
}

/* Filter Popover */
.filter-popover {
    position: fixed;
    z-index: 1001;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    max-width: 300px;
    border: 1px solid var(--color-gray-200);
}

.filter-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-gray-200);
    border-radius: 8px 8px 0 0;
}

.filter-popover-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-gray-700);
}

.filter-popover-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-gray-500);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-popover-close:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.filter-popover-body {
    padding: 12px;
}

.filter-popover-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: flex-end;
}

/* Filter input/select in popover */
.filter-popover .filter-input,
.filter-popover .filter-select {
    width: 100%;
    min-width: auto;
    margin-bottom: 8px;
}

.filter-popover .filter-input:last-child,
.filter-popover .filter-select:last-child {
    margin-bottom: 0;
}

.filter-popover label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    cursor: pointer;
}

.filter-popover label:hover {
    color: var(--color-primary);
}

.filter-popover .date-range {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-popover .date-label {
    font-size: 11px;
    color: var(--color-gray-500);
    margin-bottom: 2px;
}

/* User suggestions list */
.filter-popover .user-suggestions {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    background: white;
}

.filter-popover .user-suggestion {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--color-gray-100);
}

.filter-popover .user-suggestion:last-child {
    border-bottom: none;
}

.filter-popover .user-suggestion:hover {
}

.filter-popover .user-suggestion.selected {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.filter-popover .no-suggestions {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--color-gray-500);
    text-align: center;
}

/* Legacy filter styles (for bulk actions and modals) */
.filter-select,
.filter-input {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Bulk Actions */
.bulk-actions {
    background: white;
    border: 1px solid var(--color-gray-200);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bulk-actions #selected-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-gray-700);
}

.bulk-status-select {
    padding: 6px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-gray-700);
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.bulk-status-select:focus {
    outline: none;
    border-color: var(--color-brand-bronze);
    box-shadow: 0 0 0 2px rgba(166, 124, 82, 0.1);
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.table th {
    background: var(--color-bg-cream-darker);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.table tbody tr:hover {
}

.table tbody tr.selected {
    background: #eff6ff;
}

/* Row coloring by content type */
.table tbody tr.row-audio {
    background: #f8fbff;  /* Very light blue */
    border-left: 3px solid #3b82f6;
}

.table tbody tr.row-screenshot {
    background: #fdfaff;  /* Very light purple */
    border-left: 3px solid #8b5cf6;
}

.table tbody tr.row-text {
    background: #f9fefb;  /* Very light green */
    border-left: 3px solid #22c55e;
}

.table tbody tr.row-audio:hover {
    background: #eff6ff;
}

.table tbody tr.row-screenshot:hover {
    background: #faf5ff;
}

.table tbody tr.row-text:hover {
    background: #f0fdf4;
}

.table tbody tr.row-audio.selected {
    background: #dbeafe;
}

.table tbody tr.row-screenshot.selected {
    background: #f3e8ff;
}

.table tbody tr.row-text.selected {
    background: #dcfce7;
}

.empty-row td {
    text-align: center;
    padding: 40px;
    color: var(--color-gray-500);
}

.col-checkbox {
    width: 40px;
}

.col-type {
    width: 50px;
    text-align: center;
}

.type-icon {
    font-size: 18px;
    display: inline-block;
}

.type-icon.audio {
    color: #3b82f6;
}

.type-icon.screenshot {
    color: #8b5cf6;
}

.type-icon.text {
    color: #22c55e;
}

.col-timestamp {
    width: 160px;
    font-size: 12px;
}

.col-duration {
    width: 100px;
}

.col-status,
.col-transcription {
    width: 100px;
}

.col-tracker {
    width: 100px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-new {
    background: #dcfce7;
    color: #166534;
}

.status-in_review {
    background: #fef9c3;
    color: #854d0e;
}

.status-resolved {
    background: #dbeafe;
    color: #1e40af;
}

.status-archived {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.status-pending {
    background: #fef9c3;
    color: #854d0e;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-not_english {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

/* Content Badges */
.col-content {
    width: 140px;
}

.content-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
}

.content-badge svg {
    flex-shrink: 0;
}

.content-badge.audio {
    background: #dbeafe;
    color: #1e40af;
}

.content-badge.screenshot {
    background: #f3e8ff;
    color: #7c3aed;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

#page-info {
    color: var(--color-gray-600);
    font-size: 14px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(135deg, var(--color-bg-cream) 0%, var(--color-bg-cream-dark) 100%);
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

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

/* Detail Content */
.detail-meta {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    color: var(--color-gray-900);
    font-size: 14px;
}

.detail-url {
    word-break: break-all;
    font-size: 13px;
    color: var(--color-gray-600);
}

.detail-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row > div {
    flex: 1;
}

.detail-row-full > div {
    flex: 1 1 100%;
}

/* Feedbacks Section */
.detail-feedbacks {
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    padding: 16px;
}

.detail-feedbacks > .detail-label {
    margin-bottom: 12px;
}

.feedback-group {
    margin-bottom: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-gray-200);
}

.feedback-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.feedback-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-gray-700);
    margin-bottom: 10px;
}

.feedback-group-header svg {
    color: var(--color-gray-500);
}

.detail-audio {
    margin-bottom: 8px;
}

.detail-audio:last-of-type {
    margin-bottom: 12px;
}

.detail-audio audio {
    width: 100%;
    height: 36px;
}

.detail-audio-label {
    font-size: 12px;
    color: var(--color-gray-500);
    margin-bottom: 4px;
}

.detail-text {
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

.detail-text-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-text-item {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-radius: 6px;
}

.detail-text-number {
    font-weight: 600;
    color: var(--color-gray-500);
    flex-shrink: 0;
}

.detail-text-item .detail-text {
    background: none;
    padding: 0;
    border-radius: 0;
    flex: 1;
}

/* Transcription */
.transcription-section {
    border-radius: 6px;
    padding: 12px;
}

.transcription-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.transcription-status {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.transcription-status.status-completed {
    background: #dcfce7;
    color: #166534;
}

.transcription-status.status-pending {
    background: #fef9c3;
    color: #854d0e;
}

.transcription-status.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.transcription-status.status-not_english {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.transcription-message {
    font-size: 13px;
    color: var(--color-gray-500);
    font-style: italic;
}

.detail-transcription {
    background: white;
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid var(--color-gray-200);
}

/* Status & Tracking Actions */
.detail-actions {
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.detail-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-gray-500);
    text-transform: uppercase;
}

.detail-select {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    min-width: 130px;
}

.detail-select:focus {
    outline: none;
    border-color: var(--color-brand-bronze);
}

.control-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
}

.control-checkbox input {
    width: 16px;
    height: 16px;
}

.control-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Screenshots in Detail Modal */
.detail-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.detail-screenshot {
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.detail-screenshot img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.detail-screenshot img:hover {
    opacity: 0.85;
}

.screenshot-info {
    padding: 8px;
    font-size: 11px;
    color: var(--color-gray-500);
    text-align: center;
    border-top: 1px solid var(--color-gray-200);
    background: white;
}

/* Image Viewer Modal */
.modal-image {
    max-width: 90vw;
    max-height: 90vh;
}

.image-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--color-gray-100);
    min-height: 200px;
    max-height: 70vh;
    overflow: auto;
}

.image-modal-body img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select,
    .filter-input {
        min-width: auto;
        width: 100%;
    }

    .filter-spacer {
        display: none;
    }

    .col-project,
    .col-page {
        display: none;
    }

    .detail-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-cream) 0%, var(--color-bg-cream-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 24px 40px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-gray-200);
    position: relative;
}

/* Badge Animation - Top Right Corner */
.login-badge {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    z-index: 10;
    animation: badgeFall 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    animation-delay: 0.5s;
}

.login-badge img {
    width: 115%;
    height: 115%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.login-badge:hover img {
    transform: scale(1.1) rotate(5deg);
}

@keyframes badgeFall {
    0% {
        transform: translateY(-300px) rotate(-30deg);
        opacity: 0;
    }
    60% {
        transform: translateY(10px) rotate(5deg);
        opacity: 1;
    }
    80% {
        transform: translateY(-5px) rotate(-3deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.login-logo-img {
    height: 120px;
    object-fit: contain;
}

.login-logo-text {
    text-align: left;
}

.login-title {
    font-family: var(--font-brand);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-brand-dark-bronze);
    letter-spacing: 3px;
    margin: 0;
    line-height: 1;
}

.acronym-lines {
    font-family: var(--font-body);
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--color-gray-500);
    line-height: 1.5;
    letter-spacing: 0.8px;
    margin-top: 2px;
}

.acronym-lines div {
    margin: 0;
}

.login-subtitle {
    color: var(--color-gray-400);
    font-size: 0.90rem;
    margin-top: 8px;
    font-style: normal;
    letter-spacing: 0.8px;
}
.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-700);
    margin-bottom: 6px;
}

.login-form .form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    color: var(--color-gray-900);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .form-input:focus {
    outline: none;
    border-color: var(--color-brand-bronze);
    box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.15);
}

.login-form .form-input::placeholder {
    color: var(--color-gray-400);
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--color-danger);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: none;
}

.login-error.show {
    display: block;
}

.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--color-brand-bronze) 0%, var(--color-brand-dark-bronze) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-login:hover {
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Disabled Register Link */
.login-register {
    text-align: center;
    margin-top: 16px;
    color: var(--color-gray-500);
    font-size: 0.85rem;
    cursor: not-allowed;
    opacity: 0.6;
}

.login-register a {
    color: var(--color-brand-dark-bronze);
    text-decoration: none;
    pointer-events: none;
}

.login-learn-more {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
}

.login-learn-more a {
    color: var(--color-brand-dark-bronze);
    text-decoration: none;
}

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

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-gray-200);
    font-size: 0.75rem;
    color: var(--color-gray-400);
}

/* ==================== FILES MANAGEMENT PAGE ==================== */
.files-main {
    padding: 24px;
}

.files-container {
    /* No extra padding - let children define their own */
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.files-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gray-800);
}

.files-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.project-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-selector label {
    font-weight: 500;
    color: var(--color-gray-700);
}

.project-selector select {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.storage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.files-stats {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-bottom: 24px;
}

.files-stats .stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    color: var(--color-brand-gold);
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-brand-dark-bronze);
}

.stat-label {
    font-size: 12px;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-label {
    font-size: 12px;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-brand-dark-bronze);
}

.files-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.files-table th,
.files-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.files-table th {
    background: var(--color-bg-cream-darker);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.files-table tbody tr:hover {
    background: var(--color-gray-50);
}

/* Files table column widths to match stat cards */
.files-table .col-project {
    width: 33.33%;
}

.files-table .col-pages {
    width: 20%;
}

.files-table .col-files {
    width: 10%;
    text-align: center;
}

.files-table .col-size {
    width: 12%;
    text-align: right;
}

.files-table .col-modified {
    width: 15%;
}

.files-table .col-actions {
    width: 10%;
    text-align: center;
}

.file-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.file-type-audio {
    color: #3b82f6;
}

.file-type-image {
    color: #8b5cf6;
}

.file-type-archive {
    color: #f59e0b;
}

.archive-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.btn-archive {
    background: var(--color-brand-bronze);
    color: white;
}

.btn-archive:hover {
    background: var(--color-brand-dark-bronze);
}

.btn-clear {
    background: var(--color-danger);
    color: white;
}

.btn-clear:hover {
    background: var(--color-danger-dark);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--color-gray-600);
    margin-bottom: 8px;
}

/* Logout Button */
.btn-logout {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-600);
    padding: 6px 12px;
    font-size: 13px;
}

.btn-logout:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

/* Try Now Floating Block */
.try-now-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--color-brand-gold);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
}

.try-now-title {
    font-family: var(--font-brand);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-brand-dark-bronze);
    text-align: center;
    margin-bottom: 4px;
}

.try-now-link {
    display: block;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--color-brand-gold) 0%, var(--color-brand-bronze) 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.try-now-link:hover {
    background: linear-gradient(135deg, var(--color-brand-bright-gold) 0%, var(--color-brand-gold) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}
