/* Universal Converter Styles */
:root {
    --icon-image: #00d4ff;
    --icon-video: #ff6b6b;
    --icon-audio: #ffd93d;
    --icon-extract: #6bcb77;
    --icon-data: #4d96ff;
    --icon-resize: #c77dff;
}

.convert-container {
    max-width: 1100px;
    margin: 100px auto 50px;
    padding: 40px 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    margin-top: 20px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

/* Tool Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.15);
}

.tool-card:hover::before,
.tool-card.active::before {
    opacity: 1;
}

.tool-card.active {
    border-color: var(--accent-primary);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.icon-image {
    background: rgba(0, 212, 255, 0.15);
    color: var(--icon-image);
}

.icon-video {
    background: rgba(255, 107, 107, 0.15);
    color: var(--icon-video);
}

.icon-audio {
    background: rgba(255, 217, 61, 0.15);
    color: var(--icon-audio);
}

.icon-extract {
    background: rgba(107, 203, 119, 0.15);
    color: var(--icon-extract);
}

.icon-data {
    background: rgba(77, 150, 255, 0.15);
    color: var(--icon-data);
}

.icon-resize {
    background: rgba(199, 125, 255, 0.15);
    color: var(--icon-resize);
}

.tool-card h3 {
    font-size: 1.1rem;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-edge {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
}

/* Work Area */
.work-area {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    position: relative;
}

.work-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 20px 20px 0 0;
}

.work-area.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.work-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.drop-zone h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.drop-zone p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9rem;
}

/* Options Panel */
.options-panel {
    margin-top: 20px;
}

.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.file-item .file-icon {
    font-size: 1.5rem;
}

.file-item .file-name {
    font-weight: 500;
    flex: 1;
    word-break: break-all;
}

.file-item .file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.format-select label,
.quality-slider label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.format-select select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.format-select select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.quality-slider input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 5px;
}

.quality-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.action-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 10px;
}

/* Progress */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Download Area */
.download-area {
    margin-top: 20px;
    text-align: center;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: #0a0a0f;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    margin: 5px;
    transition: all 0.2s ease;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

/* Data Converter */
.data-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.data-tab {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.data-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.data-tab.active {
    background: var(--accent-primary);
    color: #0a0a0f;
    border-color: var(--accent-primary);
}

#data-input-area textarea,
#data-output-area textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: vertical;
}

#data-input-area textarea:focus,
#data-output-area textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

#data-output-area {
    margin-top: 20px;
}

#data-output-area textarea {
    background: rgba(0, 255, 136, 0.05);
    border-color: rgba(0, 255, 136, 0.2);
}

#data-output-area .btn {
    margin-top: 10px;
    margin-right: 10px;
}

/* Image Resizer & Cropper */
#resize-preview-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 0;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    /* Ensure cropper has space */
    min-height: 400px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

#resize-preview {
    max-width: 100%;
    /* max-height removed to let cropper handle it */
    display: block;
}

/* Resize Toolbar */
.resize-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tool-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--accent-primary);
    color: #0a0a0f;
    border-color: var(--accent-primary);
}

/* Inputs Group */
.size-input-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.resize-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.size-input input {
    text-align: center;
    font-family: var(--font-mono);
}

.size-link {
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
    margin: 0;
}

.size-link.active {
    opacity: 1;
    color: var(--accent-primary);
}

/* Customize Cropper.js look if needed */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.cropper-line,
.cropper-point {
    background-color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .convert-container {
        margin-top: 80px;
        padding: 20px 15px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .options-row {
        grid-template-columns: 1fr;
    }

    .work-area {
        padding: 20px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .data-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .resize-controls {
        flex-direction: column;
    }

    .size-link {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}