/* Custom styles for FreshFindAffiliates */

/* Root variables for consistent theming */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --hover-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

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

/* Header styles */
header {
    box-shadow: var(--box-shadow);
    z-index: 1000;
}

.nav-link:hover {
    text-decoration: underline;
    transform: translateY(-1px);
    transition: var(--transition);
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.hero-section .btn {
    transform: translateY(0);
    transition: var(--transition);
}

.hero-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

/* Product cards */
.product-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}

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

/* Product card image container */
.card-img-container {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .card-img-container img {
    transform: scale(1.05);
}

/* Card overlay for badges */
.card-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.card-overlay .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
}

/* Card body styles */
.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.card-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Price and rating styles */
.text-success {
    color: var(--success-color) !important;
}

/* Button styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Affiliate link styles */
.affiliate-link {
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.affiliate-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.affiliate-link:hover::before {
    left: 100%;
}

/* Featured products section */
#featured .product-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

#featured .card-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* About section icons */
.fa-3x {
    margin-bottom: 1rem;
}

/* Footer styles */
footer {
    background-color: var(--dark-color) !important;
    margin-top: auto;
}

/* Responsive styles */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .card-img-container {
        height: 200px;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .hero-section .btn {
        width: 100%;
        margin-top: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-img-container {
        height: 180px;
    }
}

/* Loading animation for images */
.product-card img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card img.loaded {
    opacity: 1;
}

/* Hover effects for interactive elements */
.card:hover .card-title {
    color: var(--primary-color);
    transition: var(--transition);
}

/* Badge animations */
.badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Focus states for accessibility */
.btn:focus,
.affiliate-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .sticky-top,
    footer,
    .btn {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid var(--dark-color);
    }
    
    .btn-outline-primary {
        border-width: 2px;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
