/* Responsive Styles for MagisTV Premium Theme */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .feature-card {
        padding: 2.5rem;
    }
    
    .blog-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 2rem;
    }
    
    /* Header */
    .header-content {
        padding: 0 1rem;
    }
    
    .search-input {
        width: 150px;
    }
    
    .search-input:focus {
        width: 250px;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Sections */
    .section-title {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-title {
        font-size: 1.25rem;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Single Post */
    .post-hero {
        height: 50vh;
    }
    
    .post-title {
        font-size: 2.5rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Download Section */
    .download-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    /* Comments Section - Tablet */
    .comments-area {
        padding: 0 1rem;
    }
    
    .comment-body {
        display: flex;
        gap: 15px;
    }
    
    .comment-author-avatar img {
        width: 45px;
        height: 45px;
    }
    
    .comment-form textarea {
        rows: 5;
    }
}

/* Mobile (320px - 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Header */
    .site-header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .main-navigation .nav-menu {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-search {
        display: none;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* Sections */
    .py-4 {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    .feature-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .feature-description {
        font-size: 0.9rem;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .blog-card-content {
        padding: 1rem;
    }
    
    .blog-card-title {
        font-size: 1.1rem;
    }
    
    .blog-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Single Post */
    .post-hero {
        height: 40vh;
        margin-bottom: 1rem;
    }
    
    .post-hero-content {
        padding: 1rem 0;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .post-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .post-content-wrapper {
        padding: 0 1rem;
    }
    
    .post-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .post-content h1 {
        font-size: 1.75rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .post-content blockquote {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .post-content pre {
        padding: 1rem;
        font-size: 0.85rem;
        overflow-x: auto;
    }
    
    /* Tags and Share */
    .tag-list {
        justify-content: center;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Author Bio */
    .author-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .author-details {
        text-align: center;
    }
    
    /* Related Posts */
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Download Section */
    .download-section {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }
    
    .download-title {
        font-size: 1.75rem;
    }
    
    .download-subtitle {
        font-size: 1rem;
    }
    
    .download-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .direct-download-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .version-info {
        padding: 0.75rem;
    }
    
    .version-text {
        font-size: 0.85rem;
    }
    
    /* Footer */
    .footer-social {
        margin-top: 1rem;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    /* Pagination */
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-numbers a,
    .page-numbers span {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* Ad Areas */
    .header-ad-area {
        padding: 0.5rem 0;
    }
    
    .content-ad-area {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    /* Mobile Menu */
    .mobile-nav-menu .menu-item a {
        font-size: 1.25rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Search Results */
    .search-results {
        left: -100px;
        right: -100px;
    }
    
    /* Animations - Reduce for mobile */
    .animate-fade-up,
    .animate-slide-right {
        animation-duration: 0.4s;
    }
    
    .feature-card {
        animation-delay: 0s !important;
    }
    
    /* Typography Adjustments */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* Utility Classes for Mobile */
    .mobile-hidden {
        display: none;
    }
    
    .mobile-center {
        text-align: center;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    /* ========== COMMENTS SECTION MOBILE OPTIMIZATION ========== */
    .comments-area {
        padding: 0 0.5rem;
        margin-top: 1.5rem;
    }
    
    .comments-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .comment-list {
        padding-left: 0;
        margin: 0;
    }
    
    .comment-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 1rem 0;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .comment-author-avatar {
        align-self: flex-start;
    }
    
    .comment-author-avatar img {
        width: 40px !important;
        height: 40px !important;
        border-radius: 50%;
    }
    
    .comment-content-wrap {
        width: 100%;
    }
    
    .comment-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 0.5rem;
    }
    
    .comment-author-name {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .comment-metadata {
        font-size: 0.8rem;
        color: #64748b;
    }
    
    .comment-metadata a {
        color: #64748b;
        text-decoration: none;
    }
    
    .comment-text {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    
    .comment-awaiting-moderation {
        font-size: 0.8rem;
        color: #f59e0b;
        font-style: italic;
    }
    
    .reply {
        margin-top: 0.5rem;
    }
    
    .comment-reply-link {
        display: inline-block;
        padding: 6px 12px;
        background: #3b82f6;
        color: white;
        border-radius: 4px;
        font-size: 0.8rem;
        text-decoration: none;
        transition: background-color 0.2s;
    }
    
    .comment-reply-link:hover {
        background: #2563eb;
        color: white;
    }
    
    /* Comment Form Mobile Optimization */
    .comment-form {
        margin-top: 2rem;
    }
    
    .comment-form label {
        display: block;
        margin-bottom: 0.25rem;
        font-weight: 500;
        font-size: 0.9rem;
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        font-size: 16px; /* Prevents zoom on iOS */
        background: white;
        box-sizing: border-box;
    }
    
    .comment-form textarea {
        rows: 4;
        min-height: 120px;
        resize: vertical;
    }
    
    .comment-form input:focus,
    .comment-form textarea:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    .comment-form .form-submit {
        margin-top: 1rem;
    }
    
    .comment-form .submit {
        width: 100%;
        padding: 0.75rem 1.5rem;
        background: #3b82f6;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: background-color 0.2s;
    }
    
    .comment-form .submit:hover {
        background: #2563eb;
    }
    
    .comment-notes {
        font-size: 0.85rem;
        color: #64748b;
        margin-bottom: 1rem;
    }
    
    /* Comment Navigation */
    .comment-navigation {
        display: flex;
        justify-content: space-between;
        margin: 1.5rem 0;
    }
    
    .comment-navigation a {
        padding: 0.5rem 1rem;
        background: #f1f5f9;
        color: #475569;
        text-decoration: none;
        border-radius: 4px;
        font-size: 0.85rem;
    }
    
    .comment-navigation a:hover {
        background: #e2e8f0;
    }
}

/* Extra Small Mobile (320px - 479px) */
@media (max-width: 479px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .download-title {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    /* Comments - Extra Small Mobile */
    .comments-title {
        font-size: 1.3rem;
    }
    
    .comment-body {
        padding: 0.75rem 0;
    }
    
    .comment-author-avatar img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .comment-form textarea {
        rows: 3;
        min-height: 100px;
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"] {
        padding: 0.6rem;
    }
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .post-hero {
        height: 60vh;
    }
    
    /* Comments - Landscape */
    .comment-form textarea {
        rows: 3;
    }
    
    .comments-area {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .feature-icon svg,
    .social-link svg {
        transform: scale(0.9);
    }
}

/* Print Styles */
@media print {
    .site-header,
    .hero-section,
    .footer,
    .back-to-top,
    .social-share,
    .related-posts,
    .header-ad-area,
    .content-ad-area {
        display: none !important;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }
    
    .post-content h1,
    .post-content h2,
    .post-content h3 {
        color: black;
        page-break-after: avoid;
    }
    
    .post-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .post-content blockquote {
        border-left: 3px solid black;
        background: none;
    }
    
    .post-content pre {
        background: #f5f5f5;
        color: black;
        border: 1px solid #ddd;
    }
    
    /* Hide comments when printing */
    .comments-area {
        display: none !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .parallax-bg {
        background-attachment: scroll !important;
    }
    
    .animate-fade-up,
    .animate-slide-right,
    .animate-pulse {
        animation: none !important;
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none !important;
    }
    
    .comment-reply-link {
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .glass {
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid black;
    }
    
    .btn-primary {
        background: black;
        color: white;
        border: 2px solid white;
    }
    
    .btn-secondary {
        background: white;
        color: black;
        border: 2px solid black;
    }
    
    .comment-body {
        border-bottom: 2px solid black;
    }
    
    .comment-reply-link {
        border: 1px solid black;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #1e293b;
        --dark: #f8fafc;
        --glass-bg: rgba(0, 0, 0, 0.3);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
    
    body {
        background: #0f172a;
        color: #f8fafc;
    }
    
    .site-header {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .blog-card,
    .feature-card,
    .related-post-card {
        background: #1e293b;
        color: #f8fafc;
    }
    
    .search-input {
        background: rgba(0, 0, 0, 0.5);
        color: white;
    }
    
    .search-input:focus {
        background: #1e293b;
    }
    
    /* Comments Dark Mode */
    .comments-area {
        color: #f8fafc;
    }
    
    .comment-body {
        border-bottom-color: #334155;
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        background: #1e293b;
        border-color: #334155;
        color: #f8fafc;
    }
    
    .comment-form input:focus,
    .comment-form textarea:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    
    .comment-metadata {
        color: #94a3b8;
    }
    
    .comment-navigation a {
        background: #334155;
        color: #cbd5e1;
    }
    
    .comment-navigation a:hover {
        background: #475569;
    }
}