/* Tool Pages Comprehensive Responsive Design */

/* Large Screens (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .tool-wrapper {
        max-width: 900px;
    }
}

/* Medium-Large Screens (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .tool-wrapper {
        max-width: 850px;
    }
    
    .feature-grid, .steps-grid {
        gap: 20px;
    }
    
    .feature-card, .step-card {
        padding: 15px;
    }
    
    .feature-card div i, .step-card div i {
        font-size: 28px;
    }
}

/* Medium Screens (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .tool-wrapper {
        max-width: 700px;
        padding: 30px;
    }
    
    .tool-hero {
        padding: 20px 0;
    }
    
    .tool-hero h1 {
        font-size: 24px;
    }
    
    .tool-hero p {
        font-size: 16px;
    }
    
    .feature-grid, .steps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
    
    .feature-card, .step-card {
        padding: 15px;
    }
    
    .feature-card div i, .step-card div i {
        font-size: 24px;
    }
    
    .image-cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .pdf-details {
        width: 100% !important;
    }
}

/* Small Screens (576px - 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .tool-wrapper {
        max-width: 100%;
        padding: 20px;
    }
    
    .tool-hero {
        padding: 15px 0;
    }
    
    .tool-hero h1 {
        font-size: 22px;
    }
    
    .tool-hero p {
        font-size: 14px;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .upload-icon {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .upload-text h3 {
        font-size: 16px;
    }
    
    .feature-grid, .steps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    .feature-card, .step-card {
        padding: 15px;
        border-radius: 20px;
    }
    
    .feature-card div i, .step-card div i {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .feature-card h3, .step-card h3 {
        font-size: 16px;
    }
    
    .feature-card p, .step-card p {
        font-size: 13px;
    }
    
    .image-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .tool-buttons button {
        width: 100%;
    }
    
    .pdf-details {
        width: 100% !important;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 12px;
    }
    
    .step-number {
        width: 30px !important;
        height: 30px !important;
    }
}

/* Extra Small Screens (0px - 575px) */
@media (max-width: 575px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .tool-wrapper {
        max-width: 100%;
        padding: 15px;
        margin: 20px auto;
    }
    
    .tool-hero {
        padding: 15px 0;
    }
    
    .tool-hero h1 {
        font-size: 20px;
    }
    
    .tool-hero p {
        font-size: 14px;
    }
    
    .upload-area {
        padding: 25px 15px;
    }
    
    .upload-icon {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .upload-text h3 {
        font-size: 14px;
    }
    
    .feature-grid, .steps-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .feature-card, .step-card {
        padding: 15px;
        border-radius: 15px;
    }
    
    .feature-card div i, .step-card div i {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .feature-card h3, .step-card h3 {
        font-size: 16px;
    }
    
    .feature-card p, .step-card p {
        font-size: 13px;
    }
    
    .image-cards-container {
        grid-template-columns: 1fr;
    }
    
    .image-card {
        width: 100%;
    }
    
    .tool-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .tool-buttons button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    .pdf-details {
        width: 100% !important;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 11px;
        padding: 6px 12px;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    .step-number {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    
    /* Fix for images preview */
    .preview-modal-content {
        width: 90%;
    }
    
    /* Fix for PDF details display */
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-item span:first-child {
        margin-bottom: 5px;
    }
}

/* Specific Component Fixes */

/* Modal improvements for all screen sizes */
.preview-modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

.preview-modal-image {
    max-width: 100%;
    max-height: 80vh;
}

/* Fix for drag and drop on mobile */
@media (hover: none) and (pointer: coarse) {
    .image-card {
        touch-action: none;
    }
}

/* Improve file cards on all screens */
.pdf-card-details span {
    display: inline-block;
    margin-bottom: 5px;
} 

/* Additional Mobile-Specific Improvements */

/* Better touch interactions */
@media (pointer: coarse) {
    .upload-area {
        min-height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    button, 
    .download-btn,
    .reset-btn,
    .convert-btn,
    .new-conversion-btn {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .browse-text {
        padding: 5px;
        display: inline-block;
    }
    
    /* Improve drag and drop for touch devices */
    .image-card {
        user-select: none;
    }
    
    /* Modal close buttons larger for touch */
    .preview-modal-close,
    #closeModal {
        font-size: 30px !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Fixed positioning issues on small screens */
@media (max-width: 480px) {
    .download-section {
        padding: 20px 15px !important;
    }
    
    .success-message {
        margin-bottom: 15px;
    }
    
    .success-icon {
        width: 50px !important;
        height: 50px !important;
        line-height: 50px !important;
        font-size: 24px !important;
    }
    
    .download-section h3 {
        font-size: 20px !important;
    }
    
    .download-section p {
        font-size: 14px !important;
    }
    
    .tool-buttons {
        padding: 0 !important;
    }
    
    /* Fix for form elements */
    input[type="text"],
    input[type="number"],
    input[type="password"],
    select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    /* Fix for FAQ sections */
    .faq-question h3 {
        font-size: 14px !important;
    }
    
    /* Fix for image card thumbnails */
    .pdf-card-icon {
        margin-bottom: 5px;
    }
    
    /* Better file list on mobile */
    .files-header-left h3 {
        font-size: 16px !important;
    }
    
    .files-count-badge {
        padding: 3px 8px !important;
        font-size: 12px !important;
    }
    
    /* Fix for modals */
    #imagesModal div {
        width: 95% !important;
        padding: 15px !important;
    }
    
    #imageGrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Fix for PDF details display */
.pdf-details {
    box-sizing: border-box;
}

@media (max-width: 400px) {
    .pdf-details {
        padding: 15px !important;
    }
} 

/* Specific Tool Adjustments */

/* PDF Merger - File Cards */
@media (max-width: 768px) {
    .image-cards-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .image-card {
        padding: 15px 10px !important;
        width: 100% !important;
    }
    
    .pdf-card-icon {
        font-size: 30px !important;
    }
    
    .pdf-card-name {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    
    .pdf-card-details {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .image-cards-container {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

/* JPG to PDF Image Cards */
@media (max-width: 768px) {
    #imageCardsContainer {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

@media (max-width: 480px) {
    #imageCardsContainer {
        grid-template-columns: 1fr !important;
    }
}

/* Fix for Responsive Image Modal in PDF-to-JPG */
@media (max-width: 768px) {
    #imagesModal {
        z-index: 10000 !important;
    }
    
    #imageGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
} 

/* JPG to PDF specific responsive overrides */
@media (min-width: 768px) {
    .feature-grid, .image-cards-container, #imageCardsContainer {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .tools-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 401px) and (max-width: 767px) {
    .feature-grid, .tools-grid, .image-cards-container, #imageCardsContainer {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 400px) {
    .feature-grid, .tools-grid, .image-cards-container, #imageCardsContainer {
        grid-template-columns: 1fr !important;
    }
} 