/* Image Compressor Pro Stylesheet */

.icp-page-wrapper {
    background-color: #111827;
    min-height: calc(100vh - 150px);
    padding: 40px 15px 60px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.icp-page-wrapper * {
    box-sizing: border-box;
}

/* Central Card */
.icp-container {
    max-width: 820px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 45px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Header */
.icp-header {
    text-align: center;
    margin-bottom: 30px;
}

.icp-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.icp-header p {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

/* Upload Box */
#icp-upload-box {
    border: 2px dashed #3b82f6;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 25px;
}

#icp-upload-box:hover {
    background: #f0f7ff;
    border-color: #2563eb;
    transform: translateY(-2px);
}

.icp-upload-icon-question {
    font-size: 42px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1;
}

#icp-upload-box h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

#icp-upload-box p {
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 22px 0;
}

#icp-select-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 34px;
    border-radius: 10px;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

#icp-select-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
}

/* File Preview */
.icp-file-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 25px;
    animation: icpFadeIn 0.3s ease;
}

.icp-file-preview img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.icp-file-info {
    text-align: center;
}

#icp-file-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
}

#icp-file-size {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.icp-change-file {
    font-size: 13px;
    color: #3b82f6;
    margin-top: 8px;
    cursor: pointer;
    text-decoration: underline;
    display: inline-block;
}

/* Controls */
#icp-controls {
    margin-top: 20px;
    animation: icpFadeIn 0.3s ease;
}

.icp-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px 25px;
    margin-bottom: 18px;
}

.icp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.icp-row label {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

#icp-quality-value {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
}

#icp-quality-slider {
    width: 100%;
    accent-color: #2563eb;
    height: 7px;
    cursor: pointer;
}

.icp-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.icp-format-buttons {
    display: flex;
    gap: 12px;
}

.icp-format-btn {
    flex: 1;
    background: #ffffff;
    border: 2px solid #e5e7eb !important;
    color: #374151 !important;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.icp-format-btn:hover {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

.icp-format-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#icp-compress-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 700;
    padding: 16px;
    border-radius: 12px;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

#icp-compress-btn:hover {
    opacity: 0.93;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Loading */
#icp-loading {
    margin-top: 25px;
    animation: icpFadeIn 0.3s ease;
}

.icp-loading-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
}

.icp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #dbeafe;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: icpSpin 0.9s linear infinite;
}

@keyframes icpSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.icp-loading-card h3 {
    font-size: 18px;
    color: #111827;
    margin: 0 0 15px 0;
}

.icp-progress {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
}

#icp-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #7c3aed);
    transition: width 0.1s ease;
}

#icp-progress-text {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
}

/* Results */
#icp-result {
    margin-top: 25px;
    animation: icpFadeIn 0.4s ease;
}

.icp-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.icp-preview-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.icp-preview-box h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
}

.icp-preview-box img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
}

#icp-original-size,
#icp-compressed-size {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
}

#icp-original-size {
    color: #6b7280;
}

#icp-compressed-size {
    color: #16a34a;
}

#icp-saving-box {
    background: #dcfce7;
    color: #15803d;
    padding: 16px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    border: 1px solid #bbf7d0;
}

#icp-download-btn {
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 700;
    padding: 16px;
    border-radius: 12px;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

#icp-download-btn:hover {
    opacity: 0.93;
    transform: translateY(-1px);
}

#icp-reset-btn {
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 15px;
    border-radius: 12px;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

#icp-reset-btn:hover {
    opacity: 0.93;
    transform: translateY(-1px);
}

/* How To Use */
.icp-tutorial {
    margin-top: 55px;
}

.icp-tutorial h2 {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin: 0 0 30px 0;
}

.icp-tutorial-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.icp-step-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 16px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    transition: transform 0.2s ease;
}

.icp-step-card:hover {
    transform: translateY(-3px);
}

.icp-step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.icp-step-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.icp-step-card p {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* FAQ */
.icp-faq {
    margin-top: 55px;
}

.icp-faq h2 {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin: 0 0 25px 0;
}

.icp-faq-item {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.icp-faq-btn {
    width: 100%;
    padding: 18px 20px;
    font-size: 15px;
    font-weight: 700;
    color: #111827 !important;
    text-align: left;
    background: #ffffff !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.icp-faq-btn:hover {
    background: #f8fafc !important;
}

.icp-faq-toggle {
    font-size: 20px;
    font-weight: 600;
    color: #3b82f6;
    line-height: 1;
}

.icp-faq-content {
    display: none;
    padding: 0 20px 18px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

/* Bottom Card Footer */
.icp-card-footer {
    border-top: 1px solid #f1f5f9;
    margin-top: 45px;
    padding-top: 30px;
    text-align: center;
}

.icp-footer-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    margin-bottom: 14px;
}

.icp-card-footer p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* Balloons */
#icp-balloon-container {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 99999;
}

.icp-balloon {
    position: absolute;
    bottom: -100px;
    border-radius: 50%;
    opacity: 0.9;
    animation: icpBalloonFloat 5s linear forwards;
}

@keyframes icpBalloonFloat {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-120vh) rotate(360deg); opacity: 0; }
}

@keyframes icpFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .icp-page-wrapper {
        padding: 20px 10px 40px;
    }
    
    .icp-container {
        padding: 30px 20px;
        border-radius: 18px;
    }

    .icp-header h1 {
        font-size: 26px;
    }

    .icp-tutorial-grid {
        grid-template-columns: 1fr;
    }

    .icp-preview-grid {
        grid-template-columns: 1fr;
    }

    .icp-format-buttons {
        flex-wrap: wrap;
    }

    .icp-format-btn {
        flex: 1 1 40%;
    }
}
