/* Affiliate Presenter Frontend Styles */

/* Base styles for the product grid container */
.ap-product-grid-container {
    padding: 1rem;
    color: #fff;
    font-family: 'Inter', sans-serif;
    background: transparent;
}

/* Stars styling */
.stars {
    color: #ffc107;
    letter-spacing: 2px;
    font-size: 1rem;
    line-height: 1;
}

/* Input and button base styles */
.ap-input,
.ap-btn,
.ap-select {
    background-color: #1a2a43;
    color: #fff;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.ap-input:focus,
.ap-btn:hover,
.ap-select:focus {
    background-color: #334155;
    border-color: #3b82f6;
}

.ap-btn {
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.ap-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Filter button specific styles */
.ap-filter-btn {
    background-color: #1a2a43;
    color: #cbd5e1;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    border-radius: 9999px;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.ap-filter-btn:hover {
    background-color: #334155;
    color: #f1f5f9;
    transform: translateY(-1px);
}

.ap-filter-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Filter buttons container */
#ap-filter-buttons,
#ap-filter-buttons .flex {
    flex-wrap: wrap !important;
    gap: 0.5rem;
}

/* Icons inside buttons */
.ap-filter-btn i,
.ap-btn i {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Card layout */
.ap-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0f1b2d;
    border-radius: 1rem;
    border: 1px solid #1e293b;
    transition: all 0.3s ease;
    overflow: hidden;
}

.ap-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #334155;
}

.ap-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.5rem;
}

/* Product header */
.ap-category-badge {
    background: #3b82f6;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.ap-product-name {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0.75rem 0 0.5rem 0;
    word-break: break-word;
    hyphens: auto;
}

.ap-description {
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Recipient info section */
.ap-recipient-info {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #334155;
}

.ap-recipient {
    color: #f1f5f9;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.ap-age-range {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Keywords */
.ap-keywords-container {
    margin-bottom: 1rem;
}

.ap-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ap-keyword-tag {
    background-color: #374151;
    color: #d1d5db;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #4b5563;
}

/* Bottom section */
.ap-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Price styling */
.ap-price {
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #ffffff;
    font-size: 1.5rem;
}

.ap-price-date {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Rating */
.ap-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ap-rating-text {
    color: #cbd5e1;
    font-size: 0.875rem;
}

/* CTA button */
.ap-cta {
    background: #0ea5e9;
    color: #fff !important;
    border: 0;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ap-cta:hover {
    background: #0284c7;
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.3);
}

.ap-cta:focus-visible {
    outline: 2px solid rgba(14, 165, 233, 0.7);
    outline-offset: 2px;
}

/* Advanced filters */
.ap-advanced-filters {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.ap-advanced-filters label {
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.ap-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    background-color: #0f172a;
    color: #f1f5f9;
    border: 1px solid #334155;
}

.ap-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Toggle button for advanced filters */
#ap-toggle-advanced {
    background-color: #374151;
    color: #d1d5db;
    border: 1px solid #4b5563;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

#ap-toggle-advanced:hover {
    background-color: #4b5563;
    color: #f9fafb;
}

/* Loading states */
.ap-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.ap-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #334155;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: ap-spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* No results state */
#ap-no-results {
    color: #64748b;
    text-align: center;
    padding: 3rem 1rem;
}

#ap-no-results i {
    color: #475569;
    margin-bottom: 1rem;
}

#ap-no-results h3 {
    color: #cbd5e1;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Search input */
#ap-search-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    background-color: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#ap-search-input:focus {
    background-color: #334155;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

#ap-search-input::placeholder {
    color: #64748b;
}

/* Responsive design */
@media (max-width: 768px) {
    .ap-product-grid-container {
        padding: 0.75rem;
    }
    
    .ap-card-body {
        padding: 1.25rem;
    }
    
    .ap-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .ap-cta {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }
    
    .ap-product-name {
        font-size: 1.125rem;
    }
    
    .ap-price {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .ap-advanced-filters {
        padding: 1rem;
    }
    
    .ap-advanced-filters .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #ap-filter-buttons {
        justify-content: center;
    }
    
    .ap-filter-btn {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.625rem;
    }
}

@media (max-width: 480px) {
    .ap-card-body {
        padding: 1rem;
    }
    
    .ap-recipient-info {
        padding: 0.75rem;
    }
    
    .ap-product-name {
        font-size: 1rem;
    }
    
    .ap-description {
        font-size: 0.8125rem;
    }
    
    .ap-price {
        font-size: 1.125rem;
    }
}

/* Theme compatibility */
.ap-product-grid-container * {
    box-sizing: border-box;
}

/* Ensure text visibility */
.ap-card .ap-description,
.ap-card .ap-recipient {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ap-card {
        border: 2px solid #64748b;
    }
    
    .ap-category-badge {
        background: #1d4ed8;
    }
    
    .ap-cta {
        background: #1d4ed8;
    }
    
    .ap-filter-btn.active {
        background: #1d4ed8;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ap-card,
    .ap-btn,
    .ap-filter-btn,
    .ap-cta {
        transition: none;
    }
    
    .ap-card:hover,
    .ap-btn:hover,
    .ap-cta:hover {
        transform: none;
    }
    
    .ap-spinner {
        animation: none;
    }
}



/* Enhanced styles for improved design */

/* Improved product card footer layout */
.ap-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced CTA button styling */
.ap-cta {
    padding: 0.875rem 1.5rem !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    white-space: nowrap;
    flex-shrink: 0;
    border: none !important;
}

.ap-cta:hover {
    background-color: #1d4ed8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Price display improvements */
.ap-price-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ap-price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.ap-price-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Enhanced search and filter buttons */
.ap-btn-secondary {
    background-color: #64748b !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ap-btn-secondary:hover {
    background-color: #475569 !important;
    transform: translateY(-1px) !important;
}

/* Improved product title styling */
.ap-product-name {
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
    color: #ffffff !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Enhanced advanced filters visibility */
.ap-advanced-filters {
    background-color: rgba(45, 55, 72, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
}

.ap-advanced-filters label {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    font-size: 0.95rem !important;
}

.ap-advanced-filters select {
    background-color: #475569 !important;
    color: #ffffff !important;
    border: 2px solid #64748b !important;
    border-radius: 6px !important;
    padding: 0.75rem !important;
    width: 100% !important;
    font-size: 0.95rem !important;
}

.ap-advanced-filters select:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .ap-product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .ap-cta {
        text-align: center !important;
        padding: 1rem 1.5rem !important;
        width: 100% !important;
    }
    
    .ap-price-info {
        align-items: center;
        text-align: center;
    }
    
    .ap-price-value {
        font-size: 1.25rem !important;
    }
}

/* Ensure price and "kr" stay on same line on mobile */
@media (max-width: 480px) {
    .ap-price-value {
        white-space: nowrap !important;
        display: inline-block !important;
    }
}

/* Theme-specific enhancements */
.ap-presenter.ap-theme-light .ap-cta {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.ap-presenter.ap-theme-light .ap-cta:hover {
    background-color: #1d4ed8 !important;
}

.ap-presenter.ap-theme-colorful .ap-cta {
    background-color: #f59e0b !important;
    color: #ffffff !important;
}

.ap-presenter.ap-theme-colorful .ap-cta:hover {
    background-color: #d97706 !important;
}



/* DESIGN FIXES - Enhanced layout and styling */

/* Container improvements with margins */
.ap-presenter {
    padding: 2rem !important;
    margin: 2rem auto !important;
    max-width: 1200px !important;
}

/* Products grid with better spacing */
.ap-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
    padding: 0 1rem !important;
}

/* Product cards with clear borders and margins */
.ap-card {
    background-color: #334155 !important;
    border: 2px solid #475569 !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin: 0.5rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.ap-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
    border-color: #64748b !important;
}

/* Card header with category and rating side by side */
.ap-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 1rem !important;
}

/* Smaller category badge */
.ap-category-badge {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-radius: 16px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0 !important;
}

/* Rating to the right */
.ap-rating {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 0.25rem !important;
    text-align: right !important;
}

.ap-rating-text {
    font-size: 0.8rem !important;
    color: #cbd5e1 !important;
    white-space: nowrap !important;
}

/* Remove "Passar till:" text, keep only icon */
.ap-recipient-info strong {
    display: none !important;
}

.ap-recipient-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.9rem !important;
    color: #e2e8f0 !important;
}

.ap-recipient-info i {
    color: #3b82f6 !important;
    flex-shrink: 0 !important;
}

/* Enhanced advanced filters visibility */
.ap-advanced-filters {
    background-color: #2d3748 !important;
    border: 2px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 2rem !important;
    margin-bottom: 1.5rem !important;
}

.ap-advanced-filters label {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
    display: block !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.ap-advanced-filters select {
    background-color: #4a5568 !important;
    color: #ffffff !important;
    border: 2px solid #718096 !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    width: 100% !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
}

.ap-advanced-filters select:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    background-color: #2d3748 !important;
}

.ap-advanced-filters select option {
    background-color: #4a5568 !important;
    color: #ffffff !important;
    padding: 0.5rem !important;
}

/* Filter buttons styling */
.ap-filter-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1.25rem !important;
    background-color: #475569 !important;
    color: #e2e8f0 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-size: 0.95rem !important;
}

.ap-filter-btn:hover {
    background-color: #64748b !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.ap-filter-btn.active {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .ap-presenter {
        padding: 1rem !important;
        margin: 1rem !important;
    }
    
    .ap-products-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 !important;
    }
    
    .ap-card {
        margin: 0 !important;
    }
    
    .ap-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    .ap-rating {
        align-items: flex-start !important;
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    .ap-card {
        padding: 1rem !important;
    }
    
    .ap-advanced-filters {
        padding: 1rem !important;
    }
    
    .ap-advanced-filters label {
        font-size: 0.9rem !important;
    }
    
    .ap-advanced-filters select {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }
}

