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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    padding: 0;
    margin: 0;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: linear-gradient(135deg, #5aa9e6 0%, #7fc8f8 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Form Styles */
.product-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.product-form h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #5aa9e6;
}

.form-group {
    margin-bottom: 15px;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5aa9e6;
}

.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.error-message {
    color: #ff6392;
    font-size: 14px;
    margin: 10px 0;
    min-height: 20px;
    font-weight: 500;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #5aa9e6 0%, #7fc8f8 100%);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 169, 230, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #ff6392;
    color: white;
}

.btn-danger:hover {
    background: #ff1b5f;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
    min-height: 44px;
    min-width: 44px;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Product List */
.product-list {
    margin-bottom: 30px;
}

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

.list-header h2 {
    font-size: 20px;
    color: #333;
}

.product-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #ccc;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateX(5px);
}

.product-card.best-value {
    border-left-color: #5aa9e6;
    background: linear-gradient(to right, #deeefa 0%, white 10%);
}

.product-card.mid-value {
    border-left-color: #ffe45e;
    background: linear-gradient(to right, #fffade 0%, white 10%);
}

.product-card.worst-value {
    border-left-color: #ff6392;
    background: linear-gradient(to right, #ffdfe9 0%, white 10%);
}

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

.product-header h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.product-actions {
    display: flex;
    gap: 5px;
}

.product-details {
    font-size: 14px;
}

.product-original {
    color: #666;
    margin-bottom: 5px;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #5aa9e6;
    margin: 8px 0;
}

.product-diff {
    color: #ff6392;
    font-weight: 600;
}

.product-best {
    color: #5aa9e6;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.empty-state p:first-child {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .product-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-buttons {
        flex-direction: column;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .list-header h2 {
        text-align: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
select:focus {
    outline: 3px solid #5aa9e6;
    outline-offset: 2px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #666;
    font-size: 14px;
}

footer p {
    margin: 0;
}
