/**
 * CSS for Image Converter Tool
 * Prefix: mt-ic-
 */

/* =================================================================== */
/* Permanent Fix for Elementor/Theme Conflicts
/* =================================================================== */
.elementor-widget-container {
    overflow: visible !important;
}

/* =================================================================== */
/* Main Wrapper & Variables
/* =================================================================== */
.mt-ic-wrapper {
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --primary-pink: #ec4899;
    --success-green: #10b981;
    --warning-amber: #f59e0b;
    --error-red: #ef4444;
    --light-gray: #f9fafb;
    --border-gray: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --white-text: #ffffff; /* For button text fix */
    
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    box-sizing: border-box;
}

.mt-ic-wrapper *, .mt-ic-wrapper *::before, .mt-ic-wrapper *::after {
    box-sizing: inherit;
}

/* =================================================================== */
/* Layout & Structure
/* =================================================================== */
.mt-ic-main-container {
    max-width: 1152px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1.5rem;
    border: 2px solid #d1d5db;
    border-radius: 20px;
    background: #ffffff;
    transition: border 0.3s ease;
}

/* Hover Gradient Border Effect */
.mt-ic-main-container:hover {
    border: 2px solid transparent;
    background: linear-gradient(#ffffff, #ffffff) padding-box,
                linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899) border-box;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .mt-ic-main-container {
        padding: 1.5rem 1rem;
        border-radius: 14px;
    }
}


.mt-ic-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem; /* gap-8 */
    margin-bottom: 1rem; /* mb-12 */
}

@media (min-width: 1024px) { /* lg: */
    .mt-ic-grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =================================================================== */
/* Card Styles
/* =================================================================== */
.mt-ic-glass-card img {
  max-width: 100%;
  height: auto;
  display: block;
  /* Image ke corners ab card ke radius se control honge, isliye yahan se hata sakte hain */
}

.mt-ic-glass-card {
  overflow: hidden;
  border: 2px solid #e5e7eb; /* 2px mota border */
  border-radius: 1rem;
  transition: all 0.3s ease;
  padding: 1rem; /* YEH ADD KIYA HAI: Border aur content ke beech gap ke liye */
}

.mt-ic-glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
  /* Mobile ke liye padding pehle se hi set thi, ab yeh desktop par bhi aayegi */
  .mt-ic-glass-card {
    padding: 1rem;
  }

  .mt-ic-glass-card img {
    max-width: 100%;
    height: auto;
  }
}

.mt-ic-section-title {
    font-size: 1.5rem; /* text-2xl */
    line-height: 2rem;
    font-weight: 600; /* font-semibold */
    margin-bottom: 1.5rem; /* mb-6 */
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
}

.mt-ic-icon-svg {
    width: 1.5rem; /* w-6 */
    height: 1.5rem; /* h-6 */
    color: var(--primary-blue);
}
.mt-ic-icon-purple { color: var(--primary-purple); }
.mt-ic-icon-green { color: var(--success-green); }

/* =================================================================== */
/* Upload Zone
/* =================================================================== */
.mt-ic-upload-zone {
    border: 2px dashed var(--border-gray);
    background: rgba(249, 250, 251, 0.7);
    transition: all 0.3s ease;
    border-radius: 0.75rem; /* rounded-xl */
    padding: 3rem; /* p-12 */
    text-align: center;
    margin-bottom: 1.5rem; /* mb-6 */
    cursor: pointer;
}
.mt-ic-upload-zone.dragover {
    border-color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.1);
}
.mt-ic-upload-icon-wrapper { margin-bottom: 1rem; }
.mt-ic-upload-icon-svg {
    width: 4rem; /* w-16 */
    height: 4rem; /* h-16 */
    color: #9ca3af; /* text-gray-400 */
    margin: 0 auto 1rem;
}
.mt-ic-upload-text-main {
    font-size: 1.25rem; /* text-xl */
    font-weight: 500; /* font-medium */
    color: var(--text-secondary);
    margin-bottom: 0.5rem; /* mb-2 */
}
.mt-ic-upload-text-sub { color: var(--text-secondary); }
.mt-ic-hidden { display: none; }
.mt-ic-supported-formats-text {
    margin-top: 1rem; /* mt-4 */
    font-size: 0.875rem; /* text-sm */
    color: var(--text-secondary);
}

/* =================================================================== */
/* Buttons
/* =================================================================== */
.mt-ic-gradient-button {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    border: none;
    color: var(--white-text) !important; /* Astra Theme Fix */
    border-radius: 0.75rem; /* rounded-xl */
    font-weight: 600; /* font-semibold */
    cursor: pointer;
}
.mt-ic-gradient-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
.mt-ic-gradient-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af; /* A simple disabled background */
    box-shadow: none;
}
.mt-ic-browse-button {
    padding: 0.75rem 2rem; /* px-8 py-3 */
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
}
.mt-ic-button-icon-svg {
    width: 1rem; /* w-4 */
    height: 1rem; /* h-4 */
}
.mt-ic-convert-button {
    width: 100%;
    padding: 1rem 0; /* py-4 */
    font-size: 1.125rem; /* text-lg */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mt-ic-download-all-button {
    padding: 0.5rem 1rem; /* px-4 py-2 */
    font-weight: 500; /* font-medium */
    font-size: 0.875rem; /* text-sm */
    display: inline-flex;
    align-items: center;
}
.mt-ic-ai-button {
    color: var(--warning-amber);
    border: 1px solid #fde68a; /* border-amber-200 */
    background-color: transparent;
    padding: 0.25rem 0.75rem; /* px-3 py-1 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    cursor: pointer;
}
.mt-ic-ai-button:hover { background-color: #fffbeb; }

/* =================================================================== */
/* File List
/* =================================================================== */
.mt-ic-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* space-y-3 */
    max-height: 16rem; /* max-h-64 */
    overflow-y: auto;
}
.mt-ic-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-gray);
    transition: all 0.3s ease;
    background-color: var(--white-text);
}
.mt-ic-file-item:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }
.mt-ic-file-details { display: flex; align-items: center; gap: 0.75rem; }
.mt-ic-file-preview-img-wrapper {
    width: 3rem; /* w-12 */
    height: 3rem; /* h-12 */
    background-color: var(--light-gray);
    border-radius: 0.5rem; /* rounded-lg */
    overflow: hidden;
}
.mt-ic-file-preview-img { width: 100%; height: 100%; object-fit: cover; }
.mt-ic-file-name {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mt-ic-file-meta { font-size: 0.875rem; color: var(--text-secondary); }
.mt-ic-remove-file-btn {
    color: var(--error-red);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}
.mt-ic-remove-file-btn:hover { background-color: #fee2e2; transform: scale(1.1); }
.mt-ic-remove-file-btn svg { width: 1rem; height: 1rem; }

/* =================================================================== */
/* Settings Section
/* =================================================================== */
.mt-ic-setting-block { margin-bottom: 2rem; }
.mt-ic-format-label-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.mt-ic-label {
    display: block;
    font-size: 1.125rem; /* text-lg */
    font-weight: 500;
    color: var(--text-secondary);
}
.mt-ic-format-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
@media (min-width: 768px) { /* md: */
    .mt-ic-format-selector-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { /* lg: */
    .mt-ic-format-selector-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mt-ic-format-option {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--border-gray);
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}
.mt-ic-format-option:hover {
    border-color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.1);
}
.mt-ic-format-option.selected {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}
.mt-ic-format-option-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.mt-ic-format-option-label { font-weight: 500; }

/* Quality & Dimensions */
.mt-ic-quality-controls { display: flex; flex-direction: column; gap: 1.5rem; }
.mt-ic-sub-label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.mt-ic-range-slider-wrapper { padding: 0 0.5rem; }
.mt-ic-range-slider {
    width: 100%;
    height: 0.5rem;
    background-color: var(--border-gray);
    border-radius: 9999px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.mt-ic-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background-color: var(--primary-blue);
    border-radius: 9999px;
    border: 2px solid var(--white-text);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.mt-ic-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}
.mt-ic-quality-value-text { font-weight: 500; color: var(--primary-blue); }
.mt-ic-dimensions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

/* Mobile optimization */
@media (max-width: 640px) {
    .mt-ic-dimensions-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}


.mt-ic-number-input {
    width: 100%;
    background-color: var(--light-gray);
    border: 2px solid var(--border-gray);
    border-radius: 0.75rem;
    padding: 0.75rem;
    transition: border-color 0.2s ease;
}
.mt-ic-number-input:focus {
    border-color: var(--primary-blue);
    outline: none;
}
.mt-ic-number-input::placeholder { color: #9ca3af; }

/* =================================================================== */
/* Progress Bar & Processing State
/* =================================================================== */
.mt-ic-action-area { display: flex; flex-direction: column; gap: 0.75rem; }
.mt-ic-progress-bar {
    width: 100%;
    background-color: var(--border-gray);
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}
.mt-ic-progress-fill {
    background: linear-gradient(to right, var(--primary-blue), var(--primary-purple));
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.mt-ic-convert-button.processing { animation: pulse 2s infinite; }
.mt-ic-spinner {
    width: 1rem; height: 1rem;
    border: 2px solid var(--white-text);
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* =================================================================== */
/* Results Section
/* =================================================================== */
.mt-ic-results-container { margin-top: 2rem; }
.mt-ic-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.mt-ic-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) { .mt-ic-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mt-ic-results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.mt-ic-result-card {
    background: var(--white-text);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-gray);
    animation: successBounce 0.6s ease;
}
@keyframes successBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.mt-ic-result-card-icon {
    width: 3rem; height: 3rem; margin: 0 auto 1rem;
}
.mt-ic-result-card-icon.success { color: var(--success-green); }
.mt-ic-result-card-icon.error { color: var(--error-red); }

.mt-ic-result-filename {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mt-ic-result-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mt-ic-size-comparison-green { color: var(--success-green); font-size: 0.75rem; }
.mt-ic-size-comparison-amber { color: var(--warning-amber); font-size: 0.75rem; }
.mt-ic-result-error { color: var(--error-red); font-size: 0.875rem; }

.mt-ic-result-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mt-ic-result-buttons .mt-ic-gradient-button,
.mt-ic-result-buttons .mt-ic-secondary-button {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mt-ic-secondary-button {
    border: 1px solid var(--border-gray);
    background-color: transparent;
    color: var(--text-secondary); /* Text color set for non-gradient buttons */
}

.mt-ic-secondary-button:hover {
    background-color: var(--light-gray);
}

.mt-ic-result-buttons svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}
/* =================================================================== */
/* Preview Modal Styles
/* =================================================================== */
.mt-ic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
}

.mt-ic-modal-content {
    background-color: white;
    border-radius: 1rem; /* rounded-2xl */
    padding: 1.5rem; /* p-6 */
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: successBounce 0.4s ease; /* Reuse existing animation */
}

.mt-ic-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem; /* mb-4 */
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-gray);
}

.mt-ic-modal-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: var(--text-primary);
    margin: 0;
}

.mt-ic-modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
}
.mt-ic-modal-close-btn:hover {
    color: var(--text-primary);
}
.mt-ic-modal-close-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.mt-ic-modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* gap-6 */
}
@media (min-width: 768px) {
    .mt-ic-modal-body {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mt-ic-modal-image-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* space-y-3 */
}

.mt-ic-modal-image-title {
    font-weight: 600; /* font-semibold */
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.mt-ic-modal-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Aspect ratio 4:3 */
    background-color: var(--light-gray);
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem; /* rounded-lg */
    overflow: hidden;
}

.mt-ic-modal-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Use contain to see the whole image */
}

.mt-ic-modal-image-info {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.75rem; /* text-xs */
    padding: 0.25rem 0.5rem; /* px-2 py-1 */
    border-radius: 0.25rem;
}

.mt-ic-modal-image-format {
    font-size: 0.875rem; /* text-sm */
    color: var(--text-secondary);
    text-align: center;
}

.mt-ic-modal-error-box {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background-color: #fff5f5; /* red-50 */
    border: 1px solid #fecaca; /* red-200 */
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #b91c1c; /* red-700 */
    padding: 1rem;
}
.mt-ic-modal-error-text {
    font-size: 0.875rem;
}

.mt-ic-modal-footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.mt-ic-modal-download-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

/* =================================================================== */
/* Header, Features, and Footer Styles (Naya Code)
/* =================================================================== */

/* Header Styles */
.mt-ic-header {
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 1152px;
    margin: 0 auto;
}

.mt-ic-main-title {
    font-size: 2.25rem; /* text-4xl */
    line-height: 2.5rem;
    font-weight: 700; /* font-bold */
    margin: 0 0 1rem 0;
}
@media (min-width: 768px) {
    .mt-ic-main-title {
        font-size: 3rem; /* md:text-5xl */
        line-height: 1;
    }
}

.mt-ic-gradient-text {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple), var(--primary-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent; /* Fallback for non-webkit */
}

.mt-ic-subtitle {
    font-size: 1.25rem; /* text-xl */
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

.mt-ic-privacy-notice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
}

.mt-ic-privacy-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    color: var(--success-green);
}

/* Section Title ko h2 se h3 kiya gaya hai to font size adjust karein */
.mt-ic-section-title {
    font-size: 1.25rem; /* text-xl */
    line-height: 1.75rem;
    /* Baqi styles pehle se mojood hain */
}

/* Features Grid Styles */
.mt-ic-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* gap-6 */
    margin-bottom: 3rem; /* mb-12 */
}
@media (min-width: 768px) {
    .mt-ic-features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mt-ic-feature-item {
    padding: 1.5rem;
    text-align: center;
}

.mt-ic-feature-icon-wrapper {
    width: 4rem; /* w-16 */
    height: 4rem; /* h-16 */
    border-radius: 1rem; /* rounded-2xl */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto; /* mx-auto mb-4 */
}

.mt-ic-feature-icon {
    color: white;
    width: 2rem; /* w-8 */
    height: 2rem; /* h-8 */
}

.mt-ic-feature-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    margin-bottom: 0.75rem; /* mb-3 */
    color: var(--text-primary);
}

.mt-ic-feature-description {
    color: var(--text-secondary);
}

/* Footer Styles */
.mt-ic-footer {
    text-align: center;
    padding-top: 0rem;      /* upar space */
    padding-bottom: 0rem;   /* neeche space */
    padding-left: 1.5rem;   /* left space */
    padding-right: 1.5rem;  /* right space */
    color: var(--text-secondary);
}
