/*
====================================================
 Image Compressor Tool - Premium Styling
====================================================
*/

:root {
    --navy: #1A2A44;
    --gold: #D4AF37;
    --white: #ffffff;
    --text-main: #333333;
    --text-light: #666666;
    --soft-gray: #f5f5f5;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

.tool-page {
    padding-top: 20px;
    min-height: 100vh;
    background-color: var(--soft-gray);
}

/* Tool Header */
.tool-header {
    background: linear-gradient(135deg, var(--navy) 0%, #2A3F66 70%, var(--gold) 200%);
    color: var(--white);
    padding: 3rem 0;
    position: relative;
    margin-bottom: 2rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    overflow: hidden;
}

.tool-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.7;
}

.premium-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--gold) 0%, #F5D76E 100%);
    color: var(--navy);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1;
}

.premium-badge i {
    color: var(--navy);
}

.tool-title {
    text-align: center;
    position: relative;
    z-index: 1;
}

.tool-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1rem auto;
    border-radius: 2px;
}

.tool-description {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Premium Card */
.premium-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 3rem;
    overflow: hidden;
    position: relative;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--navy), var(--gold));
}

/* Upload Container */
.upload-container {
    padding: 2rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--gold);
}

.upload-area {
    border: 2px dashed rgba(212,175,55,0.3);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(245,245,245,0.8) 100%);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.upload-area:hover, .upload-area.highlight {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(245,245,245,0.9) 100%);
    box-shadow: inset 0 2px 15px rgba(212,175,55,0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Settings Container */
.settings-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.image-preview-container {
    flex: 1;
    background: rgba(245,245,245,0.5);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(212,175,55,0.1);
}

.image-preview-container h3 {
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.image-preview {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.image-info {
    text-align: left;
    font-size: 0.95rem;
}

.image-info p {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.compression-options {
    flex: 1;
    background: rgba(245,245,245,0.5);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(212,175,55,0.1);
}

.compression-options h3 {
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--navy);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    background: var(--white);
    transition: var(--transition);
}

select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

/* Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
    color: var(--navy);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #eee;
    border-radius: 4px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--gold);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Compression Presets */
.compression-presets {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.preset-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: 1px solid rgba(26,42,68,0.1);
    background: var(--white);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    border-color: var(--gold);
    background: rgba(212,175,55,0.05);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    box-shadow: 0 4px 15px rgba(26,42,68,0.15);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--navy), var(--gold));
    outline: none;
    padding: 0;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: var(--transition);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy) 0%, #2A3F66 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(26,42,68,0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,42,68,0.2);
}

.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1px solid rgba(26,42,68,0.2);
}

.btn-outline:hover {
    background: rgba(26,42,68,0.05);
    border-color: var(--navy);
}

/* Result Container */
.result-container {
    margin-top: 2rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.result-header h3 {
    font-size: 1.3rem;
    color: var(--navy);
}

.compression-stats {
    display: flex;
    gap: 1rem;
}

.stat-pill {
    background: linear-gradient(135deg, var(--navy) 0%, #2A3F66 100%);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.comparison-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comparison-item {
    flex: 1;
    background: rgba(245,245,245,0.5);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(212,175,55,0.1);
}

.comparison-item h4 {
    font-size: 1.1rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.comparison-preview {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-preview img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.comparison-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--gold) 0%, #F5D76E 100%);
    color: var(--navy);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(212,175,55,0.2);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212,175,55,0.3);
}

.download-size {
    background: rgba(255,255,255,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Features Section */
.features-section {
    margin: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--navy), var(--gold));
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    background: rgba(245,245,245,0.8);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* How To Section */
.how-to-section {
    margin: 4rem 0;
}

.steps-container {
    margin-top: 2rem;
}

.step-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 20px;
    width: 2px;
    height: calc(100% + 1rem);
    background: linear-gradient(to bottom, var(--gold), rgba(212,175,55,0.2));
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--navy) 0%, #2A3F66 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(26,42,68,0.15);
    position: relative;
    z-index: 1;
}

.step-content {
    padding-top: 0.5rem;
}

.step-content h3 {
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-light);
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    margin: 4rem 0;
}

.faq-container {
    margin-top: 2rem;
}

.faq-item {
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question h3 {
    font-size: 1.1rem;
    color: var(--navy);
    font-weight: 600;
    margin: 0;
}

.faq-question i {
    color: var(--gold);
    transition: var(--transition);
}

.faq-item.active .faq-question {
    background: rgba(245,245,245,0.5);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .settings-container {
        flex-direction: column;
    }
    
    .comparison-container {
        flex-direction: column;
    }
    
    .comparison-divider {
        transform: rotate(90deg);
        margin: 1rem 0;
    }
}

@media (max-width: 768px) {
    .tool-title h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .premium-badge {
        position: static;
        margin: 0 auto 1rem;
        width: fit-content;
    }
    
    .tool-header {
        padding: 2rem 0;
    }
    
    .tool-title h1 {
        font-size: 1.8rem;
    }
    
    .upload-container {
        padding: 1.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
}
