/**
 * ImageResizer.css - Image Resizer Tool Styles
 * Basic Calculator Online
 */

/* ======================= PAGE HEADER ======================= */
.page-header-section {
    position: relative;
    padding: 7rem 0 4rem;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
    overflow: hidden;
}

.page-header-bg {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.breadcrumb-nav {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #fff;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* ======================= TOOL SECTION ======================= */
.tool-section {
    padding: 3rem 0 5rem;
    background: var(--bg-body);
}

/* ======================= MODE TOGGLE ======================= */
.mode-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.mode-toggle {
    display: inline-flex;
    background: #fff;
    border-radius: 1rem;
    padding: 0.375rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.mode-btn i {
    font-size: 1.25rem;
}

/* ======================= UPLOAD CARD ======================= */
.upload-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.upload-area {
    padding: 4rem 2rem;
    border: 2px dashed #d1d5db;
    border-radius: 1rem;
    margin: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.upload-area.dragover {
    transform: scale(1.01);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.upload-icon i {
    font-size: 2.5rem;
    color: #7c3aed;
}

.upload-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-formats {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ======================= PREVIEW CARD ======================= */
.preview-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1.5rem;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: #fff;
}

.preview-header h5 {
    margin: 0;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: transparent;
    color: #fff;
    padding: 0.375rem 0.625rem;
}

.preview-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.zoom-level {
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.preview-body {
    padding: 1.5rem;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 500px;
    overflow: auto;
}

.preview-container {
    position: relative;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    overflow: hidden;
}

.preview-container img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.resize-frame {
    position: absolute;
    border: 2px dashed #7c3aed;
    background: rgba(124, 58, 237, 0.1);
    display: none;
}

.preview-footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
}

.image-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-item i {
    color: #7c3aed;
}

/* ======================= BATCH CARD ======================= */
.batch-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1.5rem;
}

.batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    color: #fff;
}

.batch-header h5 {
    margin: 0;
    font-weight: 600;
}

.batch-actions {
    display: flex;
    gap: 0.5rem;
}

.batch-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: transparent;
    color: #fff;
}

.batch-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.batch-body {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.batch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.batch-item {
    position: relative;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.batch-item:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.batch-item-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.5rem;
    background: #e2e8f0;
}

.batch-item-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-item-size {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.batch-item-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-item:hover .batch-item-remove {
    opacity: 1;
}

/* ======================= OUTPUT CARD ======================= */
.output-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1.5rem;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.output-header h5 {
    margin: 0;
    font-weight: 600;
}

.output-size {
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.output-body {
    padding: 2rem;
    background: #f8fafc;
}

.output-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.comparison-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-item img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.comparison-size {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.comparison-arrow {
    font-size: 1.5rem;
    color: #10b981;
}

.output-footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* ======================= BATCH OUTPUT CARD ======================= */
.batch-output-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1.5rem;
}

.batch-output-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.batch-output-header h5 {
    margin: 0;
    font-weight: 600;
}

.batch-output-body {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.batch-output-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.batch-output-item {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.batch-output-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.batch-output-item .item-name {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-output-item .item-size {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.batch-output-footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ======================= SETTINGS CARD ======================= */
.settings-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.settings-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
}

.settings-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-body {
    padding: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

/* Resize Methods */
.resize-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.method-option {
    cursor: pointer;
}

.method-option input {
    display: none;
}

.method-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.method-box i {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.method-box span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.method-option input:checked + .method-box {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.method-option input:checked + .method-box i,
.method-option input:checked + .method-box span {
    color: #7c3aed;
}

/* Dimensions Input */
.dimensions-input {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.dimension-field {
    flex: 1;
}

.dimension-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.dimension-field input {
    text-align: center;
    font-weight: 600;
}

.lock-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: #fff;
    border-radius: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.lock-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.lock-btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

/* Percentage Input */
.percentage-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.percentage-input .form-range {
    flex: 1;
}

.percentage-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.percentage-value input {
    width: 70px;
    text-align: center;
    font-weight: 600;
}

.percentage-value span {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Preset Sizes */
.preset-sizes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.preset-btn.active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.preset-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preset-size {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Quality Slider */
.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Custom Range Slider */
.form-range {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
    transition: transform 0.2s;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

/* ======================= INFO CARD ======================= */
.info-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
    overflow: hidden;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    font-weight: 600;
}

.info-list {
    padding: 1rem 1.25rem;
    margin: 0;
    padding-left: 2.5rem;
}

.info-list li {
    padding: 0.375rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ======================= FEATURES SECTION ======================= */
.features-section {
    padding: 5rem 0;
    background: #fff;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.0625rem;
}

.feature-card {
    background: var(--bg-body);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
}

.feature-card h5 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

.bg-primary-soft { background: rgba(124, 58, 237, 0.1); }
.bg-success-soft { background: rgba(16, 185, 129, 0.1); }
.bg-info-soft { background: rgba(59, 130, 246, 0.1); }

/* ======================= PROCESSING OVERLAY ======================= */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-content {
    background: #fff;
    border-radius: 1.5rem;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.processing-content p {
    color: var(--text-secondary);
    margin: 0;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 1rem;
    height: 8px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    border-radius: 1rem;
    transition: width 0.3s ease;
    width: 0%;
}

/* ======================= TOAST ======================= */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.custom-toast {
    background: #1e293b;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    margin-top: 0.5rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.custom-toast.success { border-left: 4px solid #10b981; }
.custom-toast.error { border-left: 4px solid #ef4444; }
.custom-toast.info { border-left: 4px solid #3b82f6; }

/* ======================= RESPONSIVE ======================= */
@media (max-width: 991.98px) {
    .page-header-section {
        padding: 6rem 0 3rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .output-comparison {
        flex-direction: column;
    }

    .comparison-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.75rem;
    }

    .mode-btn {
        padding: 0.625rem 1rem;
    }

    .mode-btn span {
        display: none;
    }

    .batch-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .preset-sizes {
        grid-template-columns: repeat(3, 1fr);
    }

    .batch-output-footer {
        flex-direction: column;
    }

    .batch-output-footer .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .tool-section {
        padding: 2rem 0 3rem;
    }

    .upload-area {
        padding: 2.5rem 1.5rem;
    }

    .dimensions-input {
        flex-wrap: wrap;
    }

    .dimension-field {
        flex: 1 1 40%;
    }

    .lock-btn {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }

    .preset-sizes {
        grid-template-columns: repeat(2, 1fr);
    }

    .image-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}