/**
 * Responsive Styles for PDF Converter Theme
 * @package PDF_Converter_Theme
 */

/* ============================================
   LARGE TABLETS & SMALL DESKTOPS (1024px)
   ============================================ */
@media (min-width: 993px) and (max-width: 1200px) {
    .container {
        max-width: 960px;
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   TABLETS (769px - 992px)
   ============================================ */
@media (min-width: 769px) and (max-width: 992px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    /* Header */
    .header-top .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header-main .container {
        flex-wrap: wrap;
    }
    
    .main-navigation .nav-menu {
        gap: 15px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 60px 20px;
        margin: 0 15px 30px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    /* Tools Grid */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .tool-card {
        padding: 20px;
    }
    
    /* Posts Grid */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Content Wrapper */
    .content-wrapper {
        gap: 30px;
    }
    
    /* Image Gallery */
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Settings Grid */
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   MOBILE LANDSCAPE (481px - 768px)
   ============================================ */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    /* Header */
    .header-top {
        display: none;
    }
    
    .header-main .container {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .site-branding {
        flex: 1;
        text-align: center;
    }
    
    .site-branding .site-title {
        font-size: 1.5rem;
    }
    
    .menu-toggle {
        display: block;
        order: 1;
    }
    
    .header-actions {
        order: 2;
    }
    
    .main-navigation {
        width: 100%;
        order: 3;
    }
    
    .main-navigation .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .main-navigation .nav-menu.show {
        display: flex;
    }
    
    .main-navigation .nav-menu li {
        width: 100%;
        text-align: center;
    }
    
    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 20px;
        display: none;
    }
    
    .main-navigation .menu-item-has-children.open .sub-menu {
        display: block;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 40px 20px;
        margin: 0 0 30px;
        border-radius: 10px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-stats .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        background: rgba(255,255,255,0.1);
        border-radius: 8px;
    }
    
    .hero-stats .stat-number {
        font-size: 1.2rem;
    }
    
    .hero-search {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-search input,
    .hero-search button {
        width: 100%;
    }
    
    /* Tool Container */
    .tool-container {
        margin: 0 0 30px;
        border-radius: 10px;
    }
    
    .tool-header {
        padding: 25px 15px;
    }
    
    .tool-header h2 {
        font-size: 1.3rem;
    }
    
    .tool-header p {
        font-size: 0.85rem;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    /* Upload Area */
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-area i {
        font-size: 2.5rem;
    }
    
    .upload-area h3 {
        font-size: 1rem;
    }
    
    /* Settings Panel */
    .settings-panel {
        padding: 15px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* Progress Bar */
    .progress-bar span {
        font-size: 0.8rem;
    }
    
    /* Results Gallery */
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Tools Grid */
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }
    
    /* Posts Grid */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-thumbnail img {
        height: 180px;
    }
    
    /* Content Wrapper */
    .content-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    /* Widgets */
    .widget {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    /* Featured Tools */
    .featured-tools-section {
        margin: 30px 0;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .tools-showcase {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-tool-card {
        padding: 20px;
    }
    
    /* Footer */
    .footer-widgets {
        padding: 40px 0 20px;
    }
    
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Pagination */
    .pagination .page-numbers {
        padding: 6px 12px;
        margin: 0 3px;
        font-size: 0.85rem;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   MOBILE PORTRAIT (320px - 480px)
   ============================================ */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    /* Header */
    .site-branding .site-title {
        font-size: 1.2rem;
    }
    
    .site-description {
        font-size: 0.7rem;
    }
    
    .header-actions .login-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 30px 15px;
    }
    
    .hero-content h1 {
        font-size: 1.2rem;
    }
    
    .hero-content p {
        font-size: 0.8rem;
    }
    
    .hero-stats .stat {
        font-size: 0.8rem;
    }
    
    .hero-stats .stat-number {
        font-size: 1rem;
    }
    
    /* Tool Header */
    .tool-header {
        padding: 20px 10px;
    }
    
    .tool-header h2 {
        font-size: 1.1rem;
    }
    
    /* Upload Area */
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-area i {
        font-size: 2rem;
    }
    
    .upload-area h3 {
        font-size: 0.9rem;
    }
    
    .upload-area p {
        font-size: 0.7rem;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    /* Post Cards */
    .entry-meta {
        font-size: 0.7rem;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .entry-title {
        font-size: 1rem;
    }
    
    .entry-summary {
        font-size: 0.85rem;
    }
    
    /* Tool Card */
    .tool-card {
        padding: 15px;
    }
    
    .tool-icon {
        width: 60px;
        height: 60px;
    }
    
    .tool-icon i {
        font-size: 1.8rem;
    }
    
    .tool-card h3 {
        font-size: 1rem;
    }
    
    .tool-card p {
        font-size: 0.8rem;
    }
    
    /* Image Card */
    .image-info p {
        font-size: 0.75rem;
    }
    
    .image-info button {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    /* Widgets */
    .widget-title {
        font-size: 1rem;
    }
    
    .popular-tools-list a,
    .recent-posts-list a {
        font-size: 0.85rem;
    }
    
    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    /* Cookie Consent */
    .cookie-consent {
        padding: 15px;
    }
    
    .cookie-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Search Results */
    .search-result-item {
        flex-direction: column;
    }
    
    .result-thumbnail {
        text-align: center;
    }
    
    .result-thumbnail img {
        width: 80px;
        height: 80px;
    }
    
    /* Filters */
    .tools-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group label {
        margin-bottom: 5px;
    }
}

/* ============================================
   TABLET LANDSCAPE (768px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-section {
        padding: 50px 20px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .hero-section,
    .featured-tools-section,
    .widget-area,
    .back-to-top,
    .header-search-form,
    .action-buttons,
    .pagination,
    .comments-area,
    .post-share {
        display: none !important;
    }
    
    .tool-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .tool-content {
        padding: 0;
    }
    
    .image-gallery {
        display: block;
    }
    
    .image-card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ============================================
   HIGH RESOLUTION SCREENS (Retina)
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-section {
        background-size: cover;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    body.dark-mode-support {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    body.dark-mode-support .tool-container,
    body.dark-mode-support .post-card,
    body.dark-mode-support .widget,
    body.dark-mode-support .tool-card {
        background: #2d2d2d;
        color: #e0e0e0;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   CUSTOM SCROLLBAR (Webkit browsers)
   ============================================ */
@media (min-width: 1025px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--primary-color, #667eea);
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--secondary-color, #764ba2);
    }
}

/* ============================================
   UTILITY CLASSES FOR RESPONSIVE
   ============================================ */
.hide-on-mobile {
    display: block;
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
    
    .show-on-mobile {
        display: block;
    }
    
    .text-center-mobile {
        text-align: center;
    }
    
    .full-width-mobile {
        width: 100%;
    }
    
    .no-padding-mobile {
        padding: 0;
    }
    
    .no-margin-mobile {
        margin: 0;
    }
}

/* ============================================
   FLEXBOX HELPERS FOR RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .flex-column-mobile {
        flex-direction: column;
    }
    
    .gap-mobile-10 {
        gap: 10px;
    }
    
    .gap-mobile-15 {
        gap: 15px;
    }
}

/* ============================================
   GRID HELPERS FOR RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .grid-mobile-1 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-tablet-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   TYPOGRAPHY RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 1025px) {
    html {
        font-size: 16px;
    }
}

/* ============================================
   BUTTONS RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .btn-small-mobile {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .btn-large-mobile {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   FORMS RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* ============================================
   TABLES RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .responsive-table {
        overflow-x: auto;
        display: block;
        width: 100%;
    }
    
    .responsive-table table {
        min-width: 600px;
    }
}

/* ============================================
   MODALS RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* ============================================
   NOTIFICATIONS RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .notification {
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
    }
}