/* ============================================================================
   ImgCraft Ad Management System - CSS Styles
   
   Includes:
   - Ad container styling (responsive, non-intrusive)
   - Ad-free modal (modern, animated)
   - AdSense-compliant spacing and separation
   ============================================================================ */

/* ============================================================================
   1. AD CONTAINER STYLING
   ============================================================================ */

/* AdSense ad containers - responsive and properly separated */
.adsbygoogle,
[data-ad-slot] {
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    padding: 1rem;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* Hover state for ad containers */
.adsbygoogle:hover,
[data-ad-slot]:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Ad container sections - clearly separated from content */
.ad-container,
.ads-section {
    position: relative;
    padding: 1.5rem 0;
    margin: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Label for ad sections */
.ad-container::before,
.ads-section::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

/* Responsive ad sizing */
@media (max-width: 768px) {
    .adsbygoogle,
    [data-ad-slot] {
        margin: 1.5rem auto;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .adsbygoogle,
    [data-ad-slot] {
        margin: 1rem auto;
        padding: 0.5rem;
    }
    
    .ad-container::before,
    .ads-section::before {
        font-size: 0.6rem;
    }
}

/* ============================================================================
   2. AD-FREE MODAL - OVERLAY AND CONTAINER
   ============================================================================ */

/* Modal overlay with backdrop blur */
.ad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

/* Show state */
.ad-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.ad-modal-container {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.ad-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.ad-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

/* ============================================================================
   3. AD-FREE MODAL - CONTENT
   ============================================================================ */

/* Modal content wrapper */
.ad-modal-content {
    text-align: center;
}

/* Icon animation */
.ad-modal-icon {
    font-size: 3.5rem;
    color: #4ade80;
    margin-bottom: 1.5rem;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Modal title */
.ad-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

/* Modal description */
.ad-modal-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ============================================================================
   4. PRICING DISPLAY
   ============================================================================ */

/* Pricing box */
.ad-pricing-box {
    position: relative;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Price display */
.ad-price-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Original price (strikethrough) */
.ad-price-original {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.3);
}

/* Current price (highlighted) */
.ad-price-current {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4ade80;
    letter-spacing: -1px;
}

/* Discount badge */
.ad-price-badge {
    position: absolute;
    top: -12px;
    right: 1.5rem;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

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

/* ============================================================================
   5. FEATURES LIST
   ============================================================================ */

/* Features list container */
.ad-features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 10px;
}

/* Feature item */
.ad-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Feature icon */
.ad-feature-item i {
    color: #4ade80;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ============================================================================
   6. MODAL ACTIONS
   ============================================================================ */

/* Actions container */
.ad-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Primary action button */
.ad-modal-actions .btn-primary {
    background: linear-gradient(135deg, #f97316, #e11d48);
    color: white;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.ad-modal-actions .btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.4);
}

.ad-modal-actions .btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
}

.ad-modal-actions .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Secondary action button */
.ad-modal-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-modal-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

/* Button full width */
.btn-full {
    width: 100% !important;
}

/* ============================================================================
   7. MODAL NOTE
   ============================================================================ */

/* Modal note/disclaimer */
.ad-modal-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-modal-note i {
    font-size: 0.85rem;
}

/* ============================================================================
   8. LOADING STATE
   ============================================================================ */

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

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* ============================================================================
   9. RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 600px) {
    .ad-modal-container {
        padding: 2rem;
        border-radius: 12px;
    }
    
    .ad-modal-close {
        top: 1rem;
        right: 1rem;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .ad-modal-title {
        font-size: 1.5rem;
    }
    
    .ad-modal-description {
        font-size: 0.9rem;
    }
    
    .ad-price-current {
        font-size: 2rem;
    }
    
    .ad-price-badge {
        right: 1rem;
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }
    
    .ad-features-list {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .ad-feature-item {
        font-size: 0.9rem;
    }
    
    .ad-modal-actions {
        gap: 0.75rem;
    }
}

@media (max-width: 400px) {
    .ad-modal-overlay {
        padding: 0.5rem;
    }
    
    .ad-modal-container {
        padding: 1.5rem;
    }
    
    .ad-modal-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .ad-modal-title {
        font-size: 1.25rem;
    }
    
    .ad-price-display {
        gap: 1rem;
    }
    
    .ad-price-original {
        font-size: 1rem;
    }
    
    .ad-price-current {
        font-size: 1.75rem;
    }
}

/* ============================================================================
   10. DARK MODE / LIGHT MODE SUPPORT
   ============================================================================ */

/* Ensure contrast for accessibility */
@media (prefers-color-scheme: light) {
    .ad-modal-container {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 245, 245, 0.95));
    }
    
    .ad-modal-title {
        color: #1e293b;
    }
    
    .ad-modal-description {
        color: rgba(30, 41, 59, 0.7);
    }
    
    .ad-feature-item {
        color: rgba(30, 41, 59, 0.85);
    }
}

/* ============================================================================
   11. PRINT STYLES
   ============================================================================ */

@media print {
    .ad-modal-overlay,
    .adsbygoogle,
    [data-ad-slot],
    .ads-section {
        display: none !important;
    }
}
