/* General styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9fb;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #3f51b5;
    color: white;
    padding: 1rem;
    text-align: center;
}

header h1 {
    margin: 0 0 0.3rem 0;
    font-size: 1.8rem;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

main {
    flex: 1;
    padding: 1rem;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

footer {
    background-color: #f0f0f5;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
}

/* Wizard step sections */
.wizard-step {
    margin-bottom: 2rem;
}

.search-bar {
    margin: 1rem 0;
}

.search-bar input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* Card container and cards */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: calc(33.333% - 1rem);
    min-width: 200px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card.selected {
    border: 2px solid #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.card img {
    width: 100%;
    object-fit: cover;
    height: 200px;
}

.card-body {
    padding: 0.5rem;
    flex: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 0.3rem 0;
}

.card-rating {
    font-size: 0.85rem;
    color: #666;
}

.card-synopsis {
    font-size: 0.8rem;
    margin-top: 0.3rem;
    color: #555;
    line-height: 1.2;
    max-height: 3.6rem;
    overflow: hidden;
}

/* Confidence indicators */
.card-confidence {
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 5px;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: #f5f5f5;
    display: inline-block;
}

/* Buttons */
.next-button {
    margin-top: 1.5rem;
    padding: 0.7rem 1.2rem;
    background-color: #3f51b5;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.next-button:hover {
    background-color: #2f3a8d;
}

/* Filter checkboxes */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group h3 {
    margin-bottom: 0.5rem;
}

.checkbox-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 0.5rem;
    background-color: #fafafa;
}

.checkbox-container label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 0.4rem;
}

/* Feedback buttons */
.card-feedback {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.feedback-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.like-btn {
    background-color: #4CAF50;
    color: white;
}

.like-btn:hover:not(:disabled) {
    background-color: #45a049;
}

.dislike-btn {
    background-color: #f44336;
    color: white;
}

.dislike-btn:hover:not(:disabled) {
    background-color: #da190b;
}

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

/* Error messages */
.error-message {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

/* Success/error states */
.success-message {
    background: #4CAF50;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    animation: slideIn 0.3s ease-out;
}

.info-message {
    background: #2196F3;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    animation: slideIn 0.3s ease-out;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card {
        width: calc(50% - 0.5rem);
        min-width: 150px;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .card-feedback {
        flex-direction: column;
        gap: 5px;
    }
    
    .feedback-btn {
        font-size: 12px;
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%;
        min-width: auto;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
}

/* Filter mode toggle styles */
.filter-mode-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-mode-container h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #495057;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
}

.filter-mode-help {
    margin: 0;
    color: #6c757d;
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

/* Enhanced recommendation card styles */
.card-confidence {
    font-weight: bold;
    font-size: 0.9rem;
    margin: 0.3rem 0;
}

.card-explanation {
    font-style: italic;
    background-color: #f8f9fa;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #28a745;
}

/* Mobile responsive for new elements */
@media (max-width: 768px) {
    .filter-mode-container {
        padding: 0.75rem;
    }
    
    .radio-group {
        gap: 0.3rem;
    }
    
    .radio-group label {
        font-size: 0.9rem;
    }
}