/* Nákup Helper - Main Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--primary);
    color: white;
}

/* Hero / Search Section */
.hero {
    padding: 40px 0 20px;
    text-align: center;
}

.hero h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.hero p {
    color: var(--gray-500);
    font-size: 16px;
    margin-bottom: 24px;
}

/* Search Box */
.search-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.search-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input-group input:focus {
    border-color: var(--primary);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

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

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

.btn-success:hover {
    background: #059669;
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Shopping List */
.shopping-list {
    margin-top: 16px;
}

.shopping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.shopping-item:hover {
    background: var(--gray-100);
}

.shopping-item .item-name {
    font-weight: 500;
}

.shopping-item .remove-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
}

.shopping-item .remove-btn:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* Results */
.results-section {
    margin-top: 24px;
}

.result-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.2s;
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
}

.result-card .store-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.result-card .result-info {
    flex: 1;
}

.result-card .product-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.result-card .store-name {
    color: var(--gray-500);
    font-size: 14px;
}

.result-card .price {
    font-size: 22px;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}

.result-card .original-price {
    font-size: 14px;
    color: var(--gray-500);
    text-decoration: line-through;
    margin-left: 8px;
}

.result-card .discount-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.result-card .validity {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Fridge Upload */
.fridge-upload {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    text-align: center;
}

.upload-zone {
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 48px 24px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-zone .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-zone h3 {
    margin-bottom: 8px;
    color: var(--gray-700);
}

.upload-zone p {
    color: var(--gray-500);
    font-size: 14px;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.fridge-preview {
    margin-top: 16px;
    display: none;
}

.fridge-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
}

/* AI Results */
.ai-results {
    margin-top: 24px;
    text-align: left;
}

.ai-results h3 {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.missing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 8px;
}

.missing-item .item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.missing-item .category-icon {
    font-size: 20px;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 24px;
}

.loading.active {
    display: block;
}

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

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

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 10px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.tab.active {
    background: white;
    color: var(--gray-900);
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--gray-500);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 22px; }
    .search-input-group { flex-direction: column; }
    .result-card { flex-direction: column; }
    .result-card .store-logo { width: 48px; height: 48px; }
    .nav-links a { padding: 6px 12px; font-size: 13px; }
}
