/**
 * SEO Enhancements CSS
 * Ensures Lighthouse SEO requirements are met:
 * - Legible font sizes (minimum 12px)
 * - Proper tap target sizes (48x48px minimum)
 * - Adequate spacing between interactive elements
 */

/* ===================================
   FONT SIZE ENFORCEMENT
   Ensure all text is at least 12px
   =================================== */

/* Base font size - ensure minimum 14px for body */
body {
    font-size: 14px !important;
    line-height: 1.6;
}

/* Ensure all text elements meet minimum size */
p, span, div, li, td, th, label, input, textarea, select {
    font-size: max(12px, 1em);
}

/* Small text should still be legible */
small, .small-text, .caption {
    font-size: 12px !important;
}

/* Ensure buttons have legible text */
button, .btn, a.btn {
    font-size: max(14px, 1em) !important;
}

/* Links should be legible */
a {
    font-size: max(12px, inherit);
}

/* Form inputs should be legible */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
textarea,
select {
    font-size: 16px !important; /* 16px prevents zoom on mobile */
}

/* ===================================
   TAP TARGET SIZING
   Minimum 48x48px for all interactive elements
   =================================== */

/* Buttons minimum size */
button,
.btn,
a.btn,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 20px;
}

/* Icon buttons should be at least 48x48 */
.icon-btn,
.btn-icon,
button[class*="icon"],
.play-trigger,
.play-btn,
button.track-icon-btn {
    min-width: 48px !important;
    min-height: 48px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Navigation links */
nav a,
.nav-link,
.navbar a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
}

/* Ensure adequate spacing between tap targets */
button + button,
.btn + .btn,
a.btn + a.btn {
    margin-left: 8px;
}

/* Mobile-specific tap target improvements */
@media (max-width: 768px) {
    /* Increase tap targets on mobile */
    button,
    .btn,
    a.btn {
        min-height: 52px;
        padding: 14px 24px;
    }
    
    /* Icon buttons on mobile */
    .icon-btn,
    .btn-icon,
    button[class*="icon"] {
        min-width: 52px !important;
        min-height: 52px !important;
    }
    
    /* Navigation on mobile */
    nav a,
    .nav-link,
    .navbar a {
        min-height: 52px;
        padding: 14px 20px;
    }
    
    /* Form inputs on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="search"],
    textarea,
    select {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Checkboxes and radio buttons */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px;
        min-height: 24px;
        margin: 12px;
    }
    
    /* Links in content */
    .content a,
    p a,
    li a {
        padding: 8px 4px;
        margin: 4px 0;
        display: inline-block;
    }
}

/* ===================================
   SPECIFIC COMPONENT FIXES
   =================================== */

/* Track card play buttons */
.track-card .play-trigger,
.track-card button[id^="play-btn"] {
    min-width: 48px !important;
    min-height: 48px !important;
    font-size: 18px;
}

/* Cart buttons */
button[id^="cart-btn"],
.btn-add-cart {
    min-width: 48px !important;
    min-height: 48px !important;
}

/* Pagination links */
.pagination a,
.pagination button {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
}

/* Social media icons */
.social-icons a,
a[class*="social"] {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Close buttons */
.close,
.btn-close,
button[aria-label="Close"] {
    min-width: 48px;
    min-height: 48px;
}

/* Dropdown toggles */
.dropdown-toggle,
button[data-toggle="dropdown"] {
    min-height: 48px;
    padding: 12px 16px;
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    text-decoration: none;
    z-index: 100;
    font-size: 16px;
}

.skip-to-content:focus {
    top: 0;
}

/* Ensure contrast for small text */
small,
.small-text,
.caption {
    color: rgba(255, 255, 255, 0.9);
}

/* ===================================
   RESPONSIVE IMPROVEMENTS
   =================================== */

/* Ensure touch-friendly spacing on all screen sizes */
@media (hover: none) and (pointer: coarse) {
    /* Touch device specific improvements */
    button,
    .btn,
    a.btn,
    a {
        -webkit-tap-highlight-color: rgba(0, 212, 255, 0.3);
    }
    
    /* Increase spacing between interactive elements */
    .btn-group button,
    .button-group button {
        margin: 4px;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    /* Ensure legible font sizes in print */
    body {
        font-size: 12pt;
    }
    
    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
    h4 { font-size: 14pt; }
    h5 { font-size: 12pt; }
    h6 { font-size: 12pt; }
}
