/* Use theme variables from themes.css */
/* Classification Category Colors - fallback if themes.css not loaded */
:root {
    --restricted-external: #7c3aed;
    --restricted-internal: #dc2626;
    --confidential-external: #ea580c;
    --confidential-internal: #f59e0b;
    --internal-use-only: #3b82f6;
    --public: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start, #667eea) 0%, var(--gradient-end, #764ba2) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary, #111827);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg, 0 4px 6px rgba(0, 0, 0, 0.1));
    transition: background 0.3s ease, box-shadow 0.3s ease;
    text-align: center; /* Center all content */
    position: relative; /* Added for absolute positioned auth buttons */
}

.header h1 {
    color: var(--primary-color, #1e3a8a);
    font-size: 2.5em;
    margin-bottom: 10px;
    display: inline-flex; /* Changed from flex to inline-flex */
    align-items: center;
    gap: 15px;
    justify-content: center; /* Center the heading */
}

.header h1::before {
    font-size: 1.2em;
}

.header p {
    color: var(--text-secondary, #6b7280);
    font-size: 1.1em;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Card Styles */
.card {
    background: var(--bg-primary, white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.card-header h2 {
    color: var(--text-primary, #1e3a8a);
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Upload Section */
.upload-area {
    border: 3px dashed var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-secondary, #f9fafb);
}

.upload-area:hover {
    border-color: var(--secondary-color, #3b82f6);
    background: var(--bg-hover, #f0f9ff);
}

.upload-area.dragging {
    border-color: var(--success-color, #10b981);
    background: var(--bg-hover, #f0fdf4);
}

.upload-area.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg-tertiary, #f3f4f6);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 15px;
}

.file-input {
    display: none;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Center text horizontally */
    gap: 8px;
    text-align: center; /* Center text */
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary, #6b7280);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-primary, #374151);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.selected-file {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary, #f0f9ff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-name {
    color: var(--text-primary);
    font-weight: 500;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.remove-file {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9em;
}

.remove-file:hover {
    background: #dc2626;
}

/* Progress Bar */
.progress-container {
    margin-top: 20px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Results Section */
.results-container {
    display: none;
}

.classification-result {
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-public {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.result-internal {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.result-confidential {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.result-restricted {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-category {
    font-size: 1.8em;
    font-weight: 700;
}

.confidence-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.result-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.reasoning-text {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 6px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.metadata-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 6px;
}

.metadata-label {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.metadata-value {
    font-size: 1.1em;
    font-weight: 600;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.stat-card:hover::before {
    transform: translateX(100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 3em;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 0.95em;
    opacity: 0.95;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: var(--toast-error-bg, #fee2e2);
    color: var(--danger-color, #991b1b);
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: var(--toast-success-bg, #d1fae5);
    color: var(--success-color, #065f46);
    border-left: 4px solid var(--success-color);
}

.alert-info {
    background: var(--toast-info-bg, #dbeafe);
    color: var(--primary-color, #1e40af);
    border-left: 4px solid var(--secondary-color);
}

/* Concise Reasoning Display */
.reasoning-content-simple {
    line-height: 1.8;
    font-size: 0.95em;
    color: var(--text-secondary, #4b5563);
}

.reasoning-content-simple p {
    margin: 8px 0;
    color: var(--text-secondary, #4b5563);
}

.reasoning-content-simple strong {
    color: var(--text-primary, #111827);
    font-weight: 600;
}

.reasoning-content-simple .reasoning-list {
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

.reasoning-content-simple .reasoning-list li {
    margin: 8px 0;
    padding: 10px 15px;
    background: var(--bg-tertiary, #f3f4f6);
    border-left: 3px solid var(--secondary-color, #3b82f6);
    border-radius: 6px;
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
}

.reasoning-content-simple .reasoning-list li::before {
    content: "•";
    color: var(--secondary-color, #3b82f6);
    font-weight: bold;
    margin-right: 8px;
}

/* Classification Badge Colors */
.classification-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.classification-badge.restricted-external {
    background: linear-gradient(135deg, var(--restricted-external), #9333ea);
}

.classification-badge.restricted-internal {
    background: linear-gradient(135deg, var(--restricted-internal), #ef4444);
}

.classification-badge.confidential-external {
    background: linear-gradient(135deg, var(--confidential-external), #f97316);
}

.classification-badge.confidential-internal {
    background: linear-gradient(135deg, var(--confidential-internal), #fb923c);
}

.classification-badge.internal-use-only {
    background: linear-gradient(135deg, var(--internal-use-only), #60a5fa);
}

.classification-badge.public {
    background: linear-gradient(135deg, var(--public), #34d399);
}

/* Results Card Background Colors */
.results-card.restricted-external {
    border-top: 4px solid var(--restricted-external);
}

.results-card.restricted-internal {
    border-top: 4px solid var(--restricted-internal);
}

.results-card.confidential-external {
    border-top: 4px solid var(--confidential-external);
}

.results-card.confidential-internal {
    border-top: 4px solid var(--confidential-internal);
}

.results-card.internal-use-only {
    border-top: 4px solid var(--internal-use-only);
}

.results-card.public {
    border-top: 4px solid var(--public);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Batch Upload Styles */
.batch-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.batch-file-item:hover {
    background: var(--bg-hover, #f3f4f6);
    transform: translateX(5px);
}

.batch-file-info {
    flex: 1;
}

.batch-file-name {
    font-weight: 500;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}

.batch-file-size {
    font-size: 0.85em;
    color: var(--text-secondary, #6b7280);
}

.batch-file-remove {
    background: var(--danger-color, #ef4444);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1em;
}

.batch-file-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.batch-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

/* Collapsible Dropdown Results */
.result-dropdown-header {
    transition: background 0.2s ease;
}

.result-dropdown-header:hover {
    background: var(--bg-tertiary, #f3f4f6) !important;
}

/* Slide-in animation for results */
@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.result-dropdown-header:active {
    transform: scale(0.98);
}

.result-dropdown-body {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 30px;
}

.footer p {
    font-size: 0.9em;
    opacity: 0.9;
}

