/**
 * GeschenkFinder KI - Custom Styles
 */

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Container Spacing */
.container {
    max-width: 1200px;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,123,255,0.05), rgba(0,123,255,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.product-card:hover::before {
    opacity: 1;
}

/* Clickable card indicator */
.product-card:active {
    transform: translateY(-3px);
}

.product-image {
    height: 200px;
    object-fit: contain;
    background-color: #f8f9fa;
    padding: 10px;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6rem;
}

.product-explanation {
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 3.6rem;
}

.product-price {
    font-weight: 700;
    color: #e74c3c !important;
}

/* Rating Badge */
.rating-badge {
    font-size: 0.75rem;
    padding: 0.4em 0.6em;
    border-radius: 20px;
}

/* Search Form */
#giftQuery {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: vertical;
    min-height: 120px;
}

#giftQuery:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.amazon-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    border: none !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: white !important;
    text-decoration: none !important;
    display: inline-block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
}

.amazon-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%) !important;
    transform: translateY(-1px) !important;
    color: white !important;
    text-decoration: none !important;
}

.amazon-btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 107, 0.25) !important;
    color: white !important;
}

/* Card Link Styling */
.card-link {
    color: inherit !important;
    text-decoration: none !important;
    display: block !important;
    cursor: pointer !important;
}

.card-link:hover {
    color: inherit !important;
    text-decoration: none !important;
}

.card-link:focus {
    color: inherit !important;
    text-decoration: none !important;
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Make the fake button look like a real button but not clickable */
.card-link .amazon-btn {
    pointer-events: none !important; /* Button styling but not clickable */
}

/* Legacy affiliate-link class - deprecated */
.affiliate-link {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.affiliate-link:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
    transform: translateY(-1px);
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Progress Bar */
.progress {
    border-radius: 10px;
    background-color: rgba(13, 110, 253, 0.1);
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 12px;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fdf2f2;
    border-left-color: #e74c3c;
    color: #c0392b;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Character Counter */
#charCount {
    font-weight: 600;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Results Meta */
#resultsMeta {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
}

/* Responsive Design - Mobile First */
@media (max-width: 991px) {
    /* Mobile/Tablet: Volle Breite */
    .main-container {
        max-width: 100% !important;
        padding: 0 15px !important;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile: Kompakte Navigation */
    .navbar-brand {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    /* Kleine Mobile Geräte */
    .container-fluid {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Kompakte Filter auf Mobile */
    .row.g-3 > div {
        margin-bottom: 1rem;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
}

/* Loading State */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading .btn-primary {
    background: #6c757d;
    pointer-events: none;
}

/* Search Form Focus State */
.search-form-focused {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
    border-radius: 12px;
}

/* Product Card Availability */
.availability-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    font-weight: 600;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    animation: slideInUp 0.5s ease-out;
}

.cookie-banner-content {
    padding: 1rem 0;
}

.cookie-text h6 {
    color: white;
    font-weight: 600;
}

.cookie-text p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.cookie-buttons .btn {
    min-width: 100px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cookie-buttons .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.cookie-buttons .btn-light {
    background-color: white;
    color: #2c3e50;
    border: none;
}

.cookie-buttons .btn-light:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

.cookie-banner.fade-out {
    animation: slideOutDown 0.4s ease-in forwards;
}

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

/* Mobile Responsiveness for Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 0.75rem 0;
    }
    
    .cookie-text h6 {
        font-size: 0.95rem;
    }
    
    .cookie-text p {
        font-size: 0.8rem;
    }
    
    .cookie-buttons {
        justify-content: center !important;
    }
    
    .cookie-buttons .btn {
        min-width: 80px;
        font-size: 0.8rem;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}