/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #06b6d4;
    --secondary-dark: #0891b2;
    --secondary-light: #22d3ee;
    --accent: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f0f9ff;
    --bg-light: #e0f2fe;
    --bg-dark: #0c4a6e;
    --surface: #ffffff;
    --text: #0c4a6e;
    --text-light: #64748b;
    --border: #bae6fd;
    --shadow: 0 1px 3px 0 rgba(14, 165, 233, 0.1), 0 1px 2px 0 rgba(14, 165, 233, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(14, 165, 233, 0.15), 0 4px 6px -2px rgba(6, 182, 212, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    padding: 20px;
}

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

.login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: var(--surface);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    padding: 8px;
    background: #fee2e2;
    border-radius: 6px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-block {
    width: 100%;
}

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

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* App Layout with Sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    border-right: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 2px solid var(--border);
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo a {
    text-decoration: none;
    color: inherit;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(14, 165, 233, 0.05);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item svg {
    stroke: currentColor;
}

.nav-item-primary {
    margin: 8px 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 8px;
    border: none;
    justify-content: center;
}

.nav-item-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    border-left-color: transparent;
}

.nav-item-primary.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    border-left-color: transparent;
}

.sidebar-footer {
    padding: 16px 0;
    border-top: 2px solid var(--border);
}

.nav-item-logout {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.nav-item-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-left-color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.content-header p {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.dashboard-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
}

.card-primary {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.card-secondary {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
}

.card-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.dashboard-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
}

.dashboard-card p {
    font-size: 16px;
    color: var(--text-light);
    margin: 0 0 24px 0;
}

.btn-white {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

/* Navbar (for pages without sidebar) */
.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    border-bottom: 2px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.section {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.section:hover {
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.1);
}

.section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* Type Selector */
.type-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.type-btn {
    flex: 1;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
}

.type-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.type-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.type-btn svg {
    stroke: currentColor;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.upload-area:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-content svg {
    color: var(--text-light);
}

.upload-content p {
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
}

/* File Preview */
.file-preview {
    margin-top: 16px;
}

.preview-image img,
.preview-video video {
    max-width: min(500px, 40vw);
    max-height: min(400px, 50vh);
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.preview-image p,
.preview-video p {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 14px;
}

/* Configuration */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.config-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.config-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.config-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
    transform: translateY(-2px);
}

.checkbox-label-modern {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label-modern input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.checkbox-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.checkbox-label-modern small {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-number-modern {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 200px;
    transition: all 0.2s;
}

.input-number-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item.full-width {
    grid-column: 1 / -1;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.checkbox-label:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.label-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.label-with-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
    user-select: none;
}

.info-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    width: 280px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    pointer-events: none;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text);
}

.info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--primary-light);
}

.tooltip-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-bottom: 8px;
}

.checkbox-label span {
    font-weight: 500;
    color: var(--text);
}

.checkbox-label small {
    font-size: 12px;
    color: var(--text-light);
}

.config-item label:not(.checkbox-label) {
    font-weight: 500;
    color: var(--text);
}

.input-number {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    max-width: 200px;
}

.input-number:focus {
    outline: none;
    border-color: var(--primary);
}

.config-item small {
    font-size: 12px;
    color: var(--text-light);
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Results */
.results-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.result-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}

.result-card.full-width {
    grid-column: 1 / -1;
}

.result-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.result-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    text-align: center;
}

.result-item img {
    max-width: min(500px, 40vw);
    max-height: min(400px, 50vh);
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.result-item p {
    font-size: 14px;
    color: var(--text-light);
}

.video-results {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    margin-bottom: 16px;
}

.video-item {
    flex: 1;
    min-width: 0;
    max-width: min(500px, 40vw);
}

.video-item video {
    width: 100%;
    max-width: min(500px, 40vw);
    max-height: min(400px, 50vh);
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .video-results {
        flex-direction: column;
    }
    
    .result-images-horizontal {
        flex-direction: column;
    }
    
    .result-score-box-horizontal {
        margin-top: 16px;
    }
}

.video-item video {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.video-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.video-actions p {
    margin: 0;
    font-weight: 500;
    color: var(--text);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-small svg {
    stroke: currentColor;
}

.video-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.info-item {
    font-size: 14px;
    color: var(--text-light);
}

.result-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
}

.metric-label {
    font-weight: 500;
    color: var(--text);
}

.metric-value {
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-item {
    padding: 8px 12px;
    background: var(--surface);
    border-radius: 6px;
    font-size: 14px;
}

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

.score-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    text-align: center;
}

.score-label {
    font-size: 14px;
    color: var(--text-light);
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.task-description {
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.improvements {
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
}

.improvements ul {
    margin-top: 12px;
    padding-left: 20px;
}

.improvements li {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text);
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 16px;
}

.error-box {
    padding: 20px;
    background: #fee2e2;
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
}

.error-box h4 {
    margin-bottom: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.history-header strong {
    text-transform: capitalize;
    color: var(--text);
}

.history-date {
    font-size: 12px;
    color: var(--text-light);
}

.history-path {
    font-size: 14px;
    color: var(--text-light);
    word-break: break-all;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.project-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.15);
    transform: translateY(-4px);
}

.project-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.project-icon {
    font-size: 48px;
    line-height: 1;
}

.project-info {
    flex: 1;
}

.project-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.project-meta {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.project-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-icon {
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
}

.btn-icon-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.project-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-block {
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.config-section {
    margin-top: 24px;
}

/* Project Detail */
.project-header-large {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
}

.project-icon-large {
    font-size: 64px;
    line-height: 1;
}

.project-header-large h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.project-meta-large {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
}

.analyses-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.analysis-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
}

.analysis-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

/* Horizontal Analysis Cards */
.analysis-card-horizontal {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    display: block;
}

.analysis-card-horizontal:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
    transform: translateY(-2px);
}

.analysis-header-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.analysis-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analysis-content-horizontal {
    width: 100%;
}

/* Horizontal Image Results */
.result-images-horizontal {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

.result-item-horizontal {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: min(300px, 35vw);
    align-items: center;
    text-align: center;
}

.result-item-horizontal img {
    width: 100%;
    max-width: min(500px, 40vw);
    max-height: min(400px, 50vh);
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.result-item-horizontal img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.2);
}

/* Vertical Image Results (kept for backward compatibility) */
.result-images-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.result-item-vertical {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item-vertical img {
    width: 100%;
    max-width: min(500px, 40vw);
    max-height: min(400px, 50vh);
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.result-item-vertical img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.2);
}

.result-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0;
}

/* Score Box */
.result-score-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid var(--primary);
    margin-top: 16px;
}

/* Horizontal Score Box (for side-by-side with images) */
.result-score-box-horizontal {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid var(--primary);
    min-width: 200px;
}

.score-label-large {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.score-value-large {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

/* Horizontal Metrics */
.result-metrics-horizontal {
    display: flex;
    gap: 20px;
    width: 100%;
}

.metric-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.metric-box:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    transform: translateY(-2px);
}

.metric-box .metric-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
    text-align: center;
}

.metric-box .metric-value-large {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

/* Score Grid (for AI Image Score - horizontal) */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    width: 100%;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.score-item:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    transform: translateY(-2px);
}

.score-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
    text-align: center;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.analysis-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.analysis-date {
    font-size: 14px;
    color: var(--text-light);
}

.analysis-content {
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .section {
        padding: 16px;
    }
    
    .type-selector {
        flex-direction: column;
    }
    
    .config-grid,
    .config-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .content-header h1 {
        font-size: 24px;
    }
}

