/* 
* KarlGoods.com Responsive CSS
* This file contains responsive styles for the KarlGoods.com website
*/

/* ======== Large Desktop (1200px and up) ======== */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

/* ======== Desktop (992px - 1199px) ======== */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    h1 {
        font-size: 3.8rem;
    }
    
    h2 {
        font-size: 3.2rem;
    }
    
    .carousel-container {
        height: 500px;
    }
    
    .carousel-content h2 {
        font-size: 3.2rem;
    }
    
    .section-header h2 {
        font-size: 2.8rem;
    }
    
    .playlists-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ======== Tablet (768px - 991px) ======== */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    html {
        font-size: 58%;
    }
    
    .main-nav ul {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: #fff;
        padding: 2rem;
        z-index: 900;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-nav.active {
        transform: translateX(0);
    }
    
    .mobile-nav ul {
        display: block;
    }
    
    .mobile-nav li {
        margin-bottom: 1.5rem;
    }
    
    .mobile-nav a {
        display: block;
        font-size: 1.8rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--light-gray-color);
    }
    
    .mobile-dropdown {
        display: none;
        padding-left: 2rem;
        margin-top: 1rem;
    }
    
    .mobile-dropdown.active {
        display: block;
    }
    
    .dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .dropdown-toggle i {
        transition: transform 0.3s ease;
    }
    
    .dropdown-toggle.active i {
        transform: rotate(180deg);
    }
    
    .carousel-container {
        height: 450px;
    }
    
    .carousel-content {
        padding: 3rem;
    }
    
    .carousel-content h2 {
        font-size: 2.8rem;
        max-width: 600px;
    }
    
    .carousel-content p {
        font-size: 1.6rem;
        max-width: 500px;
    }
    
    .articles-grid, .playlists-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .payment-methods {
        margin-top: 1.5rem;
        justify-content: center;
    }
}

/* ======== Mobile Large (576px - 767px) ======== */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    html {
        font-size: 55%;
    }
    
    h1 {
        font-size: 3.2rem;
    }
    
    h2 {
        font-size: 2.8rem;
    }
    
    h3 {
        font-size: 2rem;
    }
    
    .header-buttons {
        margin-left: auto;
    }
    
    .carousel-container {
        height: 400px;
    }
    
    .carousel-content {
        padding: 2rem;
    }
    
    .carousel-content h2 {
        font-size: 2.4rem;
        max-width: 500px;
    }
    
    .carousel-content p {
        font-size: 1.6rem;
        max-width: 400px;
        margin-bottom: 2rem;
    }
    
    .carousel-controls {
        bottom: 1.5rem;
        right: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-controls {
        margin-top: 1.5rem;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 1rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .filter-controls::-webkit-scrollbar {
        display: none;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .playlists-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .newsletter-form input[type="email"] {
        border-radius: var(--border-radius);
        margin-bottom: 1.5rem;
    }
    
    .btn-subscribe {
        width: 100%;
        border-radius: var(--border-radius);
        padding: 1.2rem;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-links-column {
        padding-bottom: 2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .footer-links-column:last-child {
        border-bottom: none;
    }
}

/* ======== Mobile Small (Up to 575px) ======== */
@media (max-width: 575px) {
    .container {
        max-width: 100%;
        padding: 0 1.5rem;
    }
    
    html {
        font-size: 52%;
    }
    
    .logo img {
        height: 40px;
    }
    
    .carousel-container {
        height: 350px;
    }
    
    .carousel-content {
        padding: 1.5rem;
    }
    
    .carousel-content h2 {
        font-size: 2.2rem;
        max-width: 100%;
    }
    
    .carousel-content p {
        font-size: 1.5rem;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .carousel-controls {
        bottom: 1rem;
        right: 1.5rem;
    }
    
    .carousel-prev, .carousel-next {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.6rem;
    }
    
    .section {
        padding: 3rem 0;
        margin-bottom: 3rem;
    }
    
    .section-header h2 {
        font-size: 2.4rem;
    }
    
    .article-img {
        height: 180px;
    }
    
    .article-content h3 {
        font-size: 1.7rem;
    }
    
    .playlist-thumbnail {
        height: 180px;
    }
    
    .play-icon {
        width: 5rem;
        height: 5rem;
        font-size: 1.8rem;
    }
    
    .newsletter-content h2 {
        font-size: 2.4rem;
    }
    
    .newsletter-content p {
        font-size: 1.6rem;
    }
    
    .form-check label {
        font-size: 1.3rem;
    }
    
    .footer-top {
        padding-bottom: 2rem;
    }
    
    .social-link {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* ======== Print Styles ======== */
@media print {
    header, footer, .newsletter-section, .btn, .social-links {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .carousel-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .article-card, .playlist-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 20pt;
    }
    
    img {
        max-width: 100% !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
}

/* ======== Retina/High DPI Adjustments ======== */
@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi) {
    .logo img, .footer-logo img, .payment-methods img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ======== Dark Mode Support ======== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-color: #f9f9f9;
        --light-color: #2f3542;
        --gray-color: #a9a9a9;
        --light-gray-color: #3f4551;
    }
    
    body {
        background-color: #1a1d25;
        color: #f9f9f9;
    }
    
    header, .search-container, .dropdown, .article-card, .playlist-card, .mobile-nav {
        background-color: #2f3542;
    }
    
    .search-form input {
        background-color: #3f4551;
        color: #f9f9f9;
        border-color: #3f4551;
    }
    
    .article-content p, .playlist-content p {
        color: #a9a9a9;
    }
    
    .dropdown a {
        border-bottom-color: #3f4551;
    }
    
    .search-close, .search-toggle, .mobile-menu-toggle {
        color: #f9f9f9;
    }
    
    .footer-bottom {
        border-top-color: rgba(255, 255, 255, 0.05);
    }
    
    /* Add dark mode toggle styles */
    .dark-mode-toggle {
        width: 4rem;
        height: 4rem;
        border-radius: 50%;
        background-color: transparent;
        color: #f9f9f9;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 1.5rem;
        font-size: 1.8rem;
        transition: background-color var(--transition-speed) ease;
    }
    
    .dark-mode-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}