@import url('lib/tailwindcss/dist/preflight.css');
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --accent: #d97706;
    --accent-hover: #f59e0b;
    --text: #ffffff;
    --text-muted: #888888;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: 'Heebo', Arial, sans-serif;
    direction: rtl;
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

/* Header with logo */
.header {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 3rem;
}

.logo {
    max-width: 250px;
    height: auto;
}

.settings-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.settings-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

/* Camera preview area */
.preview-area {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3/4;
    background: var(--bg-secondary);
    border: 2px dashed #333;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    overflow: hidden;
}

.preview-area.active {
    border-style: solid;
    border-color: var(--accent);
}

.preview-area video,
.preview-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.preview-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Primary button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #000;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Heebo', Arial, sans-serif;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary svg {
    width: 24px;
    height: 24px;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid #333;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Heebo', Arial, sans-serif;
    margin-top: 1rem;
}

.btn-secondary:hover {
    border-color: var(--accent);
}

/* Results section */
.results {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.result-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.result-card-label {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-bottom: 1px solid #333;
}

.result-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text);
    font-size: 1.125rem;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid #ef4444;
    padding: 1rem 2rem;
    border-radius: 8px;
    color: var(--text);
    z-index: 200;
}

/* Settings page */
.settings-page {
    padding: 2rem 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-btn {
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

.back-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--text);
    font-family: 'Heebo', Arial, sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Blazor error UI */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 1rem;
    background: #1a1a1a;
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: white;
    z-index: 1000;
}
