/**
 * ConvMaster - Image Resizer Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.tool-header__icon .icon--blue {
    background: rgba(59, 130, 246, 0.15);
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   RESIZER WIDGET
   ===================================================== */
.resizer {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* =====================================================
   DROP ZONE
   ===================================================== */
.resizer__dropzone {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.resizer__dropzone:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.resizer__dropzone--active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

.resizer__dropzone-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.resizer__dropzone-icon svg {
    width: 100%;
    height: 100%;
}

.resizer__dropzone-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.resizer__dropzone-hint {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

.resizer__dropzone-formats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   FORMAT BADGES
   ===================================================== */
.format-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    border-radius: 4px;
    text-transform: uppercase;
}

.format-badge--png {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.format-badge--jpg,
.format-badge--jpeg {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.format-badge--webp {
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
}

.format-badge--avif {
    background: rgba(6, 182, 212, 0.15);
    color: #06B6D4;
}

.format-badge--gif {
    background: rgba(249, 115, 22, 0.15);
    color: #F97316;
}

/* =====================================================
   HIDDEN ATTRIBUTE SUPPORT
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   WORKSPACE
   ===================================================== */
.resizer__workspace {
    padding: 1.5rem;
}

/* =====================================================
   MODE TABS
   ===================================================== */
.resizer__tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.resizer__tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resizer__tab:hover {
    color: var(--text-primary);
}

.resizer__tab--active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   PREVIEW SECTION
   ===================================================== */
.resizer__preview {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .resizer__preview {
        grid-template-columns: 1fr;
    }
    
    .resizer__preview-arrow {
        transform: rotate(90deg);
    }
}

.resizer__preview-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.resizer__preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.resizer__preview-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 300px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.resizer__preview-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.resizer__preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
}

.resizer__placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.resizer__preview-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.size-info,
.dims-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.resizer__preview-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.resizer__preview-arrow svg {
    width: 32px;
    height: 32px;
}

/* =====================================================
   ZOOM CONTROLS
   ===================================================== */
.resizer__zoom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.resizer__zoom label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.resizer__zoom-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-secondary);
    border-radius: 2px;
    outline: none;
}

.resizer__zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.resizer__zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.resizer__zoom-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.resizer__zoom span {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* =====================================================
   CROP OVERLAY
   ===================================================== */
.resizer__crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: crosshair;
}

.resizer__crop-selection {
    position: absolute;
    border: 2px dashed var(--primary);
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    min-width: 20px;
    min-height: 20px;
}

.resizer__crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid white;
    border-radius: 2px;
}

.resizer__crop-handle--nw { top: -6px; left: -6px; cursor: nw-resize; }
.resizer__crop-handle--n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resizer__crop-handle--ne { top: -6px; right: -6px; cursor: ne-resize; }
.resizer__crop-handle--e { top: 50%; right: -6px; transform: translateY(-50%); cursor: e-resize; }
.resizer__crop-handle--se { bottom: -6px; right: -6px; cursor: se-resize; }
.resizer__crop-handle--s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resizer__crop-handle--sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.resizer__crop-handle--w { top: 50%; left: -6px; transform: translateY(-50%); cursor: w-resize; }

/* =====================================================
   OPTIONS SECTION
   ===================================================== */
.resizer__options {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.resizer__options-grid {
    display: grid;
    gap: 1.5rem;
}

.resizer__option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resizer__option--full {
    grid-column: 1 / -1;
}

.resizer__option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.resizer__option-value {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
}

/* =====================================================
   MODE TOGGLE
   ===================================================== */
.resizer__mode-toggle {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.resizer__mode-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resizer__mode-btn:hover {
    color: var(--text-primary);
}

.resizer__mode-btn--active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   DIMENSION INPUTS
   ===================================================== */
.resizer__dimensions {
    grid-column: 1 / -1;
}

.resizer__dimension-inputs {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.resizer__dimension-field {
    flex: 1;
}

.resizer__dimension-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.resizer__input-group {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.resizer__input-group input {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    min-width: 0;
}

.resizer__input-group input:focus {
    outline: none;
}

.resizer__input-group:focus-within {
    border-color: var(--primary);
}

.resizer__input-unit {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--bg-tertiary);
}

.resizer__link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.resizer__link-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.resizer__link-btn--active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* =====================================================
   PRESETS
   ===================================================== */
.resizer__presets {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.resizer__presets label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.resizer__preset-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.resizer__preset-btn {
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resizer__preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* =====================================================
   PERCENT MODE
   ===================================================== */
.resizer__percent {
    grid-column: 1 / -1;
}

.resizer__percent-slider {
    margin-bottom: 1rem;
}

.resizer__percent-result {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.resizer__percent-result span {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
}

/* =====================================================
   RATIO BUTTONS
   ===================================================== */
.resizer__ratio-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.resizer__ratio-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resizer__ratio-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.resizer__ratio-btn--active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* =====================================================
   CROP INFO
   ===================================================== */
.resizer__crop-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.resizer__crop-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resizer__crop-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.resizer__crop-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

/* =====================================================
   SLIDER
   ===================================================== */
.resizer__slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
}

.resizer__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.resizer__slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.resizer__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resizer__slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================================================
   ACTIONS
   ===================================================== */
.resizer__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.resizer__actions .btn {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 480px) {
    .resizer__actions {
        flex-direction: column;
    }
    
    .resizer__actions .btn {
        width: 100%;
    }
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

.btn--primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn--success {
    background: #10B981;
    color: white;
}

.btn--success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.resizer__progress {
    margin-top: 1.5rem;
}

.resizer__progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.resizer__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60A5FA);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.resizer__progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

/* =====================================================
   ERROR BOX
   ===================================================== */
.resizer__error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    color: #EF4444;
}

.resizer__error p {
    margin: 0;
    font-size: 0.9rem;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 3rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.step-card__number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #60A5FA);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Formats Table */
.formats-table {
    overflow-x: auto;
}

.formats-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.formats-table th,
.formats-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.formats-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.formats-table td {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.formats-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.formats-table tbody tr:last-child td {
    border-bottom: none;
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .tool-page {
        padding: 1rem;
    }
    
    .tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .resizer__dropzone {
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    .resizer__workspace {
        padding: 1rem;
    }
    
    .resizer__dimension-inputs {
        flex-direction: column;
    }
    
    .resizer__link-btn {
        align-self: center;
        transform: rotate(90deg);
    }
    
    .resizer__crop-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}
