/* Main Layout */
.tool-wrapper {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 40px;
}

.app-logo {
    width: 10%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 16px;
    /* Optional: adds a slight rounded corner similar to other elements */
}

#mainTitle {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

.top-nav-desc {
    text-align: center;
    margin-bottom: 20px;
    color: #555;
    font-size: 0.95rem;
}

/* Settings Area */
.settings-area {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid #e0e0e0;
}

.quality-selector .label {
    font-weight: 700;
    color: #444;
}

.radio-group {
    display: flex;
    gap: 10px;
}

.radio-btn {
    position: relative;
    cursor: pointer;
}

.radio-btn input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-btn span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.2s;
}

.radio-btn input:checked+span {
    background: #239ab1;
    color: #fff;
    border-color: #239ab1;
    box-shadow: 0 2px 5px rgba(35, 154, 177, 0.3);
}

.radio-btn:hover span {
    border-color: #239ab1;
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    min-height: 250px;
    border: 3px dashed #cbd5e0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8fafd;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #239ab1;
    background-color: #f0f9fb;
}

.drop-content {
    text-align: center;
    pointer-events: none;
    /* Let clicks pass to parent */
}

.drop-content .icon {
    font-size: 64px;
    color: #a0aec0;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.drop-zone:hover .drop-content .icon {
    color: #239ab1;
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 8px;
}

.drop-sub {
    font-size: 0.85rem;
    color: #718096;
}

/* Results Area */
.results-area {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.results-area.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.results-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
}

.batch-actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:not(:disabled):active {
    transform: translateY(1px);
}

.btn-primary {
    background: #239ab1;
    color: #fff;
    box-shadow: 0 4px 6px rgba(35, 154, 177, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: #1d8296;
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-icon-only {
    padding: 8px;
    border-radius: 50%;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.file-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.file-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}

.file-details {
    flex-grow: 1;
    margin-left: 15px;
    min-width: 0;
    /* for text truncation */
    margin-right: 15px;
}

.file-name {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-stats {
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-arrow {
    color: #a0aec0;
}

.size-old {
    text-decoration: line-through;
    color: #a0aec0;
}

.size-new {
    color: #239ab1;
    font-weight: 700;
}

.reduction-tag {
    background: #c6f6d5;
    color: #22543d;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.file-actions {
    flex-shrink: 0;
}

.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 100%;
    background: #239ab1;
    width: 0%;
    transition: width 0.2s linear;
}

/* Loading State */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #718096;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.loading .spinner {
    display: block;
}

.loading .download-btn {
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Info Section */
.app-info {
    max-width: 800px;
    margin: 0 auto;
}

.info-block {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin: 40px 0;
    border: 1px solid #eee;
}

.info-block h3 {
    border-bottom: 2px solid #239ab1;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
}

.info-list li {
    margin-bottom: 15px;
    line-height: 1.6;
}

.info-list p {
    margin-top: 5px;
    color: #555;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 600px) {

    .tool-wrapper,
    .app-info {
        padding: 20px;
        margin: 20px 10px;
    }

    .quality-selector {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 10px;
    }

    .radio-group {
        justify-content: center;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .file-thumb {
        width: 100%;
        height: 120px;
    }

    .file-details {
        margin: 0;
        width: 100%;
    }

    .file-actions {
        align-self: flex-end;
    }
}