* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

.hidden {
    display: none !important;
}

.section {
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Section */
#loginSection {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    padding: 50px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.logo {
    color: #10b981;
    margin-bottom: 20px;
}

.login-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    margin-bottom: 35px;
    font-size: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.google-btn {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.terms {
    margin-top: 25px;
    font-size: 12px;
    color: #999;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #10b981;
    font-weight: 700;
    font-size: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

#userName {
    font-weight: 500;
    color: #333;
}

.btn-logout {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #e9ecef;
    color: #333;
}

/* Main Content */
.main-content {
    padding: 40px 20px;
    min-height: calc(100vh - 140px);
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    background: white;
    border: 3px dashed #d0d0d0;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #10b981;
    background: #f0fdf9;
}

.upload-area.dragover {
    border-color: #10b981;
    background: #d1fae5;
}

.upload-area svg {
    color: #10b981;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
}

.upload-area p {
    color: #666;
    margin-bottom: 5px;
}

.file-types {
    font-size: 12px;
    color: #999;
}

/* Editor Section */
.editor-section {
    max-width: 1000px;
    margin: 0 auto;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Preview Panel */
.preview-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

.preview-header h3 {
    font-size: 18px;
    color: #333;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #e0e0e0;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    max-height: 500px;
    overflow: hidden;
}

.preview-container img {
    max-width: 100%;
    max-height: 460px;
    object-fit: contain;
    border-radius: 8px;
}

.image-info {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

/* Controls Panel */
.controls-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 10px;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #10b981;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Control Groups */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

/* Method Buttons */
.method-btns, .aspect-btns, .format-btns {
    display: flex;
    gap: 8px;
}

.method-btn, .aspect-btn, .format-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.method-btn:hover, .aspect-btn:hover, .format-btn:hover {
    border-color: #10b981;
}

.method-btn.active, .aspect-btn.active, .format-btn.active {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

/* Input Row */
.input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.input-row .input-group {
    flex: 1;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #10b981;
}

/* Lock Ratio Button */
.lock-ratio {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #999;
}

.lock-ratio.locked {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Percentage Buttons */
.percentage-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.percent-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.percent-btn:hover {
    border-color: #10b981;
}

.percent-btn.active {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

/* New Dimensions Info */
.new-dimensions {
    padding: 12px;
    background: #f0fdf9;
    border-radius: 8px;
    font-size: 14px;
    color: #059669;
    text-align: center;
}

/* Crop Preview */
.crop-preview-container {
    margin: 15px 0;
    max-height: 250px;
    overflow: hidden;
    border-radius: 8px;
}

.crop-preview-container img {
    max-width: 100%;
    display: block;
}

/* Quality Slider */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Quality Presets */
.quality-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.preset-btn {
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: #10b981;
}

.preset-btn.active {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.compress-info {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* Format Group */
.format-group {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Download Button */
.btn-download {
    margin-top: 20px;
}

/* Background Removal Tab */
.bg-remove-info {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.bg-remove-info svg {
    color: #10b981;
    margin-bottom: 10px;
}

.bg-remove-info h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.bg-remove-info p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.bg-progress {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    font-size: 13px;
    color: #666;
}

.bg-result {
    margin-top: 15px;
    padding: 12px;
    background: #ecfdf5;
    border-radius: 8px;
    text-align: center;
}

.success-text {
    color: #059669;
    font-size: 14px;
    font-weight: 500;
}

/* File Size Error Modal */
.file-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.file-error-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.file-error-modal .error-icon {
    margin-bottom: 20px;
}

.file-error-modal h3 {
    font-size: 24px;
    color: #ef4444;
    margin-bottom: 15px;
}

.file-error-modal p {
    color: #666;
    margin-bottom: 10px;
    font-size: 15px;
}

.file-error-modal strong {
    color: #333;
}

.error-tips {
    background: #fef2f2;
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.error-tips p {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 10px;
    font-size: 13px;
}

.error-tips ul {
    margin: 0;
    padding-left: 20px;
}

.error-tips li {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

/* Footer */
/* Privacy Notice */
.privacy-notice {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-top: 1px solid #b1dfbb;
    padding: 16px 20px;
}

.privacy-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.privacy-content svg {
    flex-shrink: 0;
    color: #28a745;
}

.privacy-content span {
    font-size: 14px;
    color: #155724;
    line-height: 1.5;
}

.footer {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 14px;
}

.footer a {
    color: #10b981;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 800px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 40px 25px;
        margin: 20px;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    #userName {
        display: none;
    }

    .aspect-btns {
        flex-wrap: wrap;
    }

    .aspect-btn {
        flex: 0 0 calc(33.33% - 6px);
    }
}

/* ── Pro / Upgrade Styles ─────────────────────────────── */

.pro-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.upgrade-btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.upgrade-btn:hover { opacity: 0.88; }

.pro-lock {
    display: inline-block;
    font-size: 9px;
    background: #f59e0b;
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 3px;
    letter-spacing: 0.03em;
}

/* Upgrade Modal */
.upgrade-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.upgrade-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aaa;
}
.modal-close:hover { color: #333; }

.upgrade-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upgrade-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a2e;
}

.upgrade-sub {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.pro-features-list {
    background: #f8fffe;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    text-align: left;
}

.pro-feature-item {
    font-size: 0.88rem;
    color: #374151;
    padding: 5px 0;
}

.btn-upgrade {
    width: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    margin-bottom: 12px;
}
.btn-upgrade:hover { opacity: 0.9; }

.razorpay-note {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 10px;
}

.sustain-note {
    font-size: 0.8rem;
    color: #6b7280;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 6px;
}

.free-crop-note {
    font-size: 0.78rem;
    color: #888;
    margin-top: 8px;
}
.free-crop-note a {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
}
.free-crop-note a:hover { text-decoration: underline; }

/* Pro Success Toast */
.pro-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(16,185,129,0.4);
    white-space: nowrap;
}

/* Pricing grid for upgrade modal */
.upgrade-card-wide { max-width: 860px !important; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    text-align: left;
}
@media (max-width: 680px) {
    .pricing-grid { grid-template-columns: 1fr; }
}
.pricing-card {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 18px;
    position: relative;
}
.pricing-card-featured {
    border-color: #10b981;
    background: #f0fdf4;
}
.pricing-best {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 12px; border-radius: 20px;
    white-space: nowrap;
}
.pricing-label { font-size: 0.8rem; font-weight: 600; color: #10b981; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.pricing-price { font-size: 2rem; font-weight: 800; color: #1a1a2e; line-height: 1; }
.pricing-desc  { font-size: 0.75rem; color: #9ca3af; margin-bottom: 14px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 16px; }
.pricing-features li { font-size: 0.82rem; color: #374151; padding: 3px 0; }
.btn-outline-upgrade {
    width: 100%;
    background: #fff;
    color: #10b981;
    border: 2px solid #10b981;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.85rem; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.btn-outline-upgrade:hover { background: #10b981; color: #fff; }
