/* style/compress.css */
/* ===== TOOL HEADER ===== */
.tool-header {
    text-align: center;
    padding: 3rem 2rem 1rem;
    background: var(--accent);
    background-size: cover;
}

.tool-title {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.tool-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-light);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* ===== TOOL CONTAINER ===== */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.tool-wrapper {
    background: var(--light);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 3rem;
    position: relative;
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 3px dashed rgba(51, 51, 51, 0.2);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    background: var(--accent);
    cursor: pointer;
    margin: 2rem;
    position: relative;
}

.upload-area.highlight {
    border-color: var(--primary);
    background-color: rgba(217, 79, 79, 0.05);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.upload-text h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.upload-text p {
    color: var(--secondary-light);
    margin-bottom: 1.5rem;
}

.upload-btn {
    display: inline-block;
    background: var(--primary);
    color: var(--light);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(217, 79, 79, 0.3);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 79, 79, 0.4);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* ===== FILE INFO ===== */
.file-info-container {
    padding: 0 2rem 1rem;
    display: none;
}

.file-info-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(51, 51, 51, 0.1);
    border-radius: 8px;
    background: var(--accent);
    margin-bottom: 1rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(217, 79, 79, 0.1);
    border-radius: 6px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.file-icon i {
    color: var(--primary);
    font-size: 1.2rem;
}

.file-info {
    flex-grow: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.85rem;
    color: var(--secondary-light);
}

.file-actions {
    display: flex;
    gap: 0.8rem;
}

.file-action-btn {
    background: transparent;
    border: none;
    color: var(--secondary-light);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

/* ===== COMPRESSION OPTIONS ===== */
.options-container {
    padding: 0 2rem 1rem;
    display: none;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(51, 51, 51, 0.1);
}

.options-title {
    font-size: 1.3rem;
    color: var(--secondary);
}

.compression-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-card {
    background: var(--accent);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(51, 51, 51, 0.1);
    position: relative;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.option-card.active {
    border-color: var(--primary);
    background: rgba(217, 79, 79, 0.05);
}

.option-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.option-card h4 {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.option-card p {
    font-size: 0.9rem;
    color: var(--secondary-light);
    margin-bottom: 1.5rem;
}

.option-selector {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-card.active .option-selector {
    border-color: var(--primary);
}

.selector-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    display: none;
}

.option-card.active .selector-dot {
    display: block;
}

.compression-preview {
    background: #f1faee;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-top: 1.5rem;
    border: 1px solid rgba(225, 29, 72, 0.1);
}

.preview-original, .preview-compressed {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-icon {
    width: 50px;
    height: 50px;
    background: rgba(225, 29, 72, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-icon i {
    color: var(--primary);
    font-size: 1.5rem;
}

.preview-text {
    display: flex;
    flex-direction: column;
}

.preview-text span {
    font-size: 0.9rem;
    color: var(--secondary-light);
}

.preview-text strong {
    font-size: 1.2rem;
    color: var(--secondary);
}

.preview-arrow {
    color: var(--primary);
    font-size: 1.5rem;
    margin: 0 1rem;
}

.preview-savings {
    position: absolute;
    bottom: -15px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.3);
}

/* ===== COMPRESS ACTION ===== */
.compress-actions {
    display: flex;
    justify-content: center;
    padding: 0 2rem 2rem;
}

.compress-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.compress-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
}

.compress-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== PROGRESS INDICATOR ===== */
.progress-container {
    width: 100%;
    padding: 1.5rem 2rem;
    display: none;
}

.progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 500;
}

/* ===== ERROR MESSAGES ===== */
.error-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90%;
    max-width: 500px;
    display: none;
}

.error-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    border-top: 5px solid var(--primary);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { transform: translate(-50%, -60%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}

.error-icon {
    width: 80px;
    height: 80px;
    background: rgba(225, 29, 72, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.error-icon i {
    font-size: 2.5rem;
    color: var(--primary);
}

.error-title {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.1rem;
    color: var(--secondary-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.error-btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

.error-btn.retry {
    background: var(--primary);
    color: white;
}

.error-btn.cancel {
    background: #f1faee;
    color: var(--secondary);
}

.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    display: none;
    backdrop-filter: blur(5px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tool-title {
        font-size: 2rem;
    }
    
    .tool-subtitle {
        font-size: 1rem;
    }
    
    .compression-options {
        grid-template-columns: 1fr;
    }
    
    .compression-preview {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .preview-arrow {
        transform: rotate(90deg);
        margin: 0;
    }
    
    .preview-savings {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 0.5rem;
    }
    
    .error-card {
        padding: 1.5rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
  .upload-area {
    margin: 1rem auto;
    padding: 2rem 0.5rem;
    max-width: 95vw;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .file-info-container {
    margin: 1rem auto;
    width: 100%;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .file-info-card {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 1rem auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .file-info {
    width: 100%;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .upload-area, .file-info-container, .file-info-card {
    max-width: 99vw;
    padding: 1rem 0.2rem;
  }
}

@media (max-width: 576px) {
    .tool-header {
        padding: 2rem 1rem 0.5rem;
    }
    
    .tool-container {
        padding: 1rem;
    }
    
    .upload-area {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .compress-btn {
        width: 100%;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .error-btn {
        width: 100%;
    }
}