/* FerreCompare Style Sheet */
:root {
    --primary-color: #f59e0b; /* Warm industrial amber */
    --primary-hover: #d97706;
    --dark-bg: #1e293b;
    --dark-card: #0f172a;
    --text-main: #334155;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --epa-color: #ef4444;
    --vidri-color: #3b82f6;
    --freund-color: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1e1b4b 100%);
    color: white;
    padding: 30px 0;
    border-bottom: 4px solid var(--primary-color);
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.logo .icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
}

.tagline {
    font-size: 16px;
    color: #94a3b8;
}

/* MAIN */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 250px);
}

/* SEARCH SECTION */
.search-section {
    margin-bottom: 40px;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.search-box input {
    flex: 1;
    padding: 16px 24px;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: white;
}

.search-box input:focus {
    background-color: #fff;
}

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

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

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

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-full {
    width: 100%;
    margin-top: 15px;
}

.search-box button {
    border-radius: 0;
    padding: 0 32px;
    font-size: 18px;
}

.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
}

.alert-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* RESULTS SECTION */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.badge {
    background-color: var(--dark-bg);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* PRODUCT GRID & CARDS */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    padding: 20px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 240px;
    border-bottom: 1px solid var(--border-color);
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.best-deal-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: white;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.best-deal-tag.epa { background-color: var(--epa-color); }
.best-deal-tag.vidri { background-color: var(--vidri-color); }
.best-deal-tag.freund { background-color: var(--freund-color); }

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-brand {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-hover);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 48px;
}

.price-comparison-list {
    margin-top: auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
}

.store-name {
    color: var(--text-muted);
}

.store-price {
    font-weight: 700;
    color: var(--text-main);
}

.no-stock {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* WELCOME CARD / FEATURES */
.welcome-card {
    background-color: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 40px;
    box-shadow: var(--shadow);
}

.welcome-card h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--dark-bg);
}

.welcome-card p {
    color: var(--text-muted);
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 800px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    background-color: var(--bg-light);
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: scale(1.02);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 15px;
    display: inline-block;
}

.feature-item h3 {
    margin-bottom: 10px;
}

.feature-item p {
    font-size: 14px;
    margin-bottom: 0;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: inline-block;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1000px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlide 0.3s ease;
    overflow: hidden;
    max-height: 90vh;
}

@keyframes modalSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
}

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

.modal-loading {
    padding: 60px;
    text-align: center;
}

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

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

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    max-height: 90vh;
}

.modal-left {
    padding: 40px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background-color: white;
}

.modal-left img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
    margin: 0 auto 20px;
}

.modal-left h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.product-description {
    color: var(--text-muted);
    font-size: 14px;
}

.modal-right {
    padding: 40px;
    overflow-y: auto;
    background-color: var(--bg-light);
}

.modal-right h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.modal-price-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.modal-price-card {
    background-color: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-price-card .store-badge {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    color: white;
    margin-bottom: 10px;
}

.modal-price-card.epa .store-badge { background-color: var(--epa-color); }
.modal-price-card.vidri .store-badge { background-color: var(--vidri-color); }
.modal-price-card.freund .store-badge { background-color: var(--freund-color); }

.modal-store-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
}

.modal-price-card .btn {
    padding: 8px 12px;
    font-size: 12px;
    width: 100%;
}

.chart-container {
    background-color: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 15px;
    height: 200px;
    margin-bottom: 20px;
}

/* DEAL ANALYZER */
.deal-analyzer {
    background-color: #fef3c7;
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: #92400e;
}

/* FOOTER */
.footer {
    background-color: var(--dark-bg);
    color: #94a3b8;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-container strong {
    color: white;
}

@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .modal-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }
    .modal-right {
        padding: 20px;
    }
    .modal-price-comparison {
        grid-template-columns: 1fr;
    }
}

/* REAL-TIME SCRAPING LOADING SCREEN */
.loading-screen-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.loading-card {
    background-color: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.loading-heading h2 {
    font-size: 26px;
    color: var(--dark-bg);
    margin-bottom: 8px;
}

.loading-heading p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 30px;
}

.pulse-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.pulse-circle {
    width: 80px;
    height: 80px;
    background-color: #fef3c7;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.progress-bar-container {
    background-color: #f1f5f9;
    height: 8px;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, #f59e0b 100%);
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scraping-statuses {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    max-width: 320px;
    margin: 0 auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.pending {
    background-color: #cbd5e1;
}

.status-indicator.loading {
    background-color: var(--primary-color);
    animation: blink 1s infinite alternate;
}

.status-indicator.success {
    background-color: var(--freund-color);
    box-shadow: 0 0 8px var(--freund-color);
}

.status-indicator.error {
    background-color: var(--epa-color);
}

.status-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

@keyframes blink {
    from { opacity: 0.4; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}
