/* Root Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.hero-stats {
    display: flex;
    gap: 4rem;
    justify-content: center;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
    line-height: 1.8;
}

/* Demo Section */
.demo {
    padding: 6rem 0;
    background: var(--light-gray);
}

.demo-container {
    max-width: 900px;
    margin: 0 auto;
}

.upload-area {
    background: var(--white);
    border: 3px dashed var(--primary);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary-dark);
    background: #fafafa;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-content h3 {
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* Processing Status */
.processing-status {
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bars {
    margin-top: 2rem;
}

.progress-item {
    margin-bottom: 1rem;
    text-align: left;
}

.progress-item span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    background: var(--light-gray);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: width 0.5s;
}

/* Results */
.results-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.result-card {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
}

.result-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.result-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.result-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Pricing Section */
.pricing {
    padding: 6rem 0;
    background: var(--white);
}

/* API Call Explainer */
.api-explainer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 3rem;
    border-radius: 16px;
    margin: 3rem 0;
    box-shadow: var(--shadow-lg);
}

.api-explainer h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.explainer-text {
    font-size: 1.25rem;
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.explainer-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.example-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: start;
    gap: 1rem;
    transition: transform 0.3s;
}

.example-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.example-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.example-text strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.example-text p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.pricing-card {
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary);
    border-width: 3px;
}

.badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.plan-description {
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.price {
    margin: 2rem 0;
}

.currency {
    font-size: 1.5rem;
    vertical-align: super;
}

.amount {
    font-size: 3.5rem;
    font-weight: 800;
}

.period {
    color: var(--gray);
    font-size: 1rem;
}

.features-list {
    list-style: none;
    text-align: left;
    margin: 2rem 0;
}

.features-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-gray);
}

/* API Docs */
.api-docs {
    padding: 6rem 0;
    background: var(--dark);
    color: var(--white);
}

.api-docs .section-title {
    color: var(--white);
}

.api-docs .section-subtitle {
    color: var(--gray);
}

/* Workflow Section for Photographers */
.workflow-section {
    background: #2d3748;
    padding: 3rem;
    border-radius: 16px;
    margin: 3rem 0;
}

.workflow-section h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.workflow-intro {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.workflow-card {
    background: #1a202c;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s;
}

.workflow-card:hover {
    transform: translateY(-5px);
}

.workflow-number {
    background: var(--primary);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 1rem;
}

.workflow-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.workflow-card p {
    color: var(--gray);
    line-height: 1.6;
}

.integration-options {
    margin-top: 3rem;
    text-align: center;
}

.integration-options h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.tool-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tool-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
}

.api-technical {
    margin-top: 3rem;
}

.api-technical h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--white);
}

.api-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.api-card {
    background: #2d3748;
    padding: 2rem;
    border-radius: 12px;
}

.api-card h3 {
    margin-bottom: 1rem;
    color: var(--white);
}

.endpoint {
    margin-bottom: 1rem;
}

.method {
    background: var(--success);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 0.5rem;
}

.endpoint code {
    background: #1a202c;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--primary);
}

.code-block {
    background: #1a202c;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.api-features {
    margin-top: 3rem;
    background: #2d3748;
    padding: 2rem;
    border-radius: 12px;
}

.api-features h3 {
    margin-bottom: 1rem;
}

.api-features ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.api-features li {
    padding: 0.5rem 0;
}

/* Status Section */
.status {
    padding: 2rem 0;
    background: var(--light-gray);
}

.status h3 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status-item {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
}

.status-indicator.offline {
    background: var(--danger);
}

.status-indicator.loading {
    background: var(--warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--gray);
    line-height: 1.8;
}

.footer-section a {
    display: block;
    color: var(--gray);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Image Modal/Lightbox */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.2s;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: zoomIn 0.3s;
    background: #1a202c;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.modal-caption {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Background Color Selector */
.modal-bg-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bg-selector-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.bg-color-btn {
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-color-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.bg-color-btn.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: block;
}

.modal-body {
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Modal Before/After Side by Side */
.modal-images-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 100%;
}

.modal-image-box {
    text-align: center;
}

.modal-image-box h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.modal-image-box img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Background color for processed image */
.modal-after-box {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.modal-after-box.bg-white {
    background: white;
}

.modal-after-box.bg-gray {
    background: #808080;
}

.modal-after-box.bg-black {
    background: black;
}

@media (max-width: 768px) {
    .modal-images-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Cursor pointer for clickable images */
#removebgImage,
#retouchImage,
#cropImage {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#removebgImage:hover,
#retouchImage:hover,
#cropImage:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Before/After Comparison Slider */
.comparison-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f3f4f6;
    user-select: none;
}

.comparison-before,
.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.comparison-before img,
.comparison-after img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.comparison-after {
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0.05s ease-out;
}

.comparison-control {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    cursor: ew-resize;
    z-index: 10;
    height: 100%;
    margin: 0;
}

.comparison-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 4px;
    height: 100%;
    background: transparent;
    cursor: ew-resize;
}

.comparison-control::-moz-range-thumb {
    width: 4px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: ew-resize;
}

.comparison-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
    transition: left 0.05s ease-out;
}

.comparison-handle::before,
.comparison-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transform: translateY(-50%);
}

.comparison-handle::before {
    left: -18px;
    border-right: 2px solid white;
}

.comparison-handle::after {
    right: -18px;
    border-left: 2px solid white;
}

/* Arrows on handle */
.comparison-handle::before {
    content: '◄';
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    font-weight: bold;
}

.comparison-handle::after {
    content: '►';
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    font-weight: bold;
}

.comparison-labels {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 4;
}

.label-before,
.label-after {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { 
        transform: scale(0.7);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}
