/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;
    --primary-lighter: #fca5a5;
    --success-color: #10b981;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --red-line: #dc2626;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--red-line);
    z-index: 9999;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--red-line);
    z-index: 9999;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    border: 3px solid var(--red-line);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: var(--red-line);
}

.container::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: var(--red-line);
}

/* Header */
.header {
    background: #ffffff;
    color: var(--text-primary);
    padding: 60px 40px;
    text-align: center;
    position: relative;
    border-bottom: 3px solid var(--red-line);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--red-line);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

/* Main Content */
.main-content {
    padding: 50px 40px;
    background: #ffffff;
}

/* Form Styles */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.form-group select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: none;
}

.form-group select:hover {
    border-color: var(--red-line);
}

.form-group select:focus {
    outline: none;
    border-color: var(--red-line);
    border-width: 3px;
}

.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: white;
    transition: all 0.3s ease;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    box-shadow: none;
}

.form-group input[type="password"]:hover,
.form-group input[type="text"]:hover {
    border-color: var(--red-line);
}

.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--red-line);
    border-width: 3px;
}

.api-link {
    color: var(--red-line);
    text-decoration: underline;
    font-size: 0.85rem;
    margin-left: 10px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.api-link:hover {
    color: var(--primary-dark);
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    border: 3px dashed var(--border-color);
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.file-upload-label:hover {
    border-color: var(--red-line);
    border-style: solid;
}

.upload-icon {
    font-size: 2rem;
}

.upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.help-text {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    font-weight: 500;
}

textarea {
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

textarea:hover {
    border-color: var(--red-line);
}

textarea:focus {
    outline: none;
    border-color: var(--red-line);
    border-width: 3px;
}

/* Image Preview */
.image-preview {
    margin: 25px 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    background-color: #f1f5f9;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-remove:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 18px 28px;
    background: var(--red-line);
    color: white;
    border: 3px solid var(--red-line);
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    position: relative;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.btn-primary:active:not(:disabled) {
    background: #991b1b;
}

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

.btn-loader {
    display: inline-block;
}

/* Results Section */
.results-section {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 3px solid var(--red-line);
}

.results-section h2 {
    font-size: 1.75rem;
    margin-bottom: 30px;
    color: var(--red-line);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.result-card {
    background: white;
    border-radius: 0;
    padding: 30px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
}

.result-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--red-line);
}

.result-card:hover {
    border-color: var(--red-line);
}

.result-card.approved::before {
    background: #10b981;
}

.result-card.rejected::before {
    background: var(--red-line);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.platform-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.verdict-badge {
    padding: 10px 24px;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: none;
    transition: all 0.3s ease;
    border: 2px solid;
}

.verdict-badge.approved {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.verdict-badge.rejected {
    background: var(--red-line);
    color: white;
    border-color: var(--red-line);
}

.confidence-level {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: white;
    color: var(--red-line);
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid var(--red-line);
}

.summary-section {
    margin: 20px 0;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.summary-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.summary-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.violations-list {
    margin: 20px 0;
}

.violations-list h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--danger-color);
}

.violation-item {
    background-color: white;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 10px;
    border-left: 3px solid var(--danger-color);
    box-shadow: var(--shadow-sm);
}

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

.violation-category {
    font-weight: 600;
    color: var(--text-primary);
}

.severity-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical {
    background-color: #7f1d1d;
    color: white;
}

.severity-badge.high {
    background-color: var(--danger-color);
    color: white;
}

.severity-badge.medium {
    background-color: var(--warning-color);
    color: white;
}

.severity-badge.low {
    background-color: #fbbf24;
    color: #78350f;
}

.violation-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.recommendations-list {
    margin: 20px 0;
}

.recommendations-list h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.recommendation-item {
    background-color: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.safe-upload-status {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.safe-upload-status.safe {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.safe-upload-status.unsafe {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--danger-color);
    margin: 20px 0;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: #ffffff;
    padding: 30px 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 3px solid var(--red-line);
    position: relative;
}

.footer p {
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 25px 20px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .platform-name {
        font-size: 1.1rem;
    }

    .violation-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 20px 15px;
    }

    .file-upload-label {
        flex-direction: column;
        padding: 25px 15px;
    }

    .upload-icon {
        font-size: 1.5rem;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 14px 20px;
    }
}

/* Bulk Upload Styles */
.api-keys-section {
    margin-bottom: 25px;
}

.api-key-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.api-key-input-group input {
    flex: 1;
}

.btn-add-key,
.btn-remove-key {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.btn-add-key:hover {
    background-color: var(--primary-dark);
}

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

.btn-remove-key:hover {
    background-color: #dc2626;
}

.bulk-file-upload {
    border: 3px dashed var(--border-color);
    border-radius: 0;
    padding: 50px 30px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.bulk-file-upload:hover {
    border-color: var(--red-line);
    border-style: solid;
}

.bulk-file-upload.drag-over {
    border-color: var(--red-line);
    background: #fef2f2;
    border-style: solid;
}

.selected-files-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
}

.file-status.pending {
    background-color: #e5e7eb;
    color: #6b7280;
}

.file-status.processing {
    background-color: #dbeafe;
    color: #2563eb;
}

.file-status.completed {
    background-color: #d1fae5;
    color: #059669;
}

.file-status.error {
    background-color: #fee2e2;
    color: #dc2626;
}

.btn-remove-file {
    background-color: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.btn-remove-file:hover {
    color: #dc2626;
    transform: scale(1.2);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 0;
    overflow: hidden;
    margin-top: 24px;
    border: 2px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--red-line);
    transition: width 0.4s ease;
}

.bulk-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.image-result-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    position: relative;
}

.image-result-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--red-line);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-result-card:hover {
    border-color: var(--red-line);
}

.image-result-card:hover::after {
    opacity: 1;
}

.result-image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f1f5f9;
}

.result-card-content {
    padding: 20px;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-image-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    word-break: break-word;
}

.result-verdict {
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.result-verdict.approved {
    background-color: var(--success-color);
    color: white;
}

.result-verdict.rejected {
    background-color: var(--danger-color);
    color: white;
}

.result-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.result-violations-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.result-expand-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.result-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.api-key-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.api-key-status.active {
    background-color: #d1fae5;
    color: #059669;
}

.api-key-status.failed {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .upload-section,
    .footer {
        display: none;
    }
}
