/* Global Reset */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --glass: rgba(30, 41, 59, 0.7);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, #2e1065 0%, var(--bg-dark) 60%);
}

h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 .highlight {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text {
    max-width: 700px;
    margin: 0 auto 30px;
    color: var(--text-muted);
    font-size: 18px;
}

.benefit-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.benefit-list li {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 14px;
}

/* Tool Wrapper */
.crop-tool-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    min-height: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    margin: 0 auto;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 60px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.upload-content p {
    color: var(--text-muted);
}

/* Editor & Canvas */
.tool-editor {
    display: flex;
    flex-direction: column;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    /* Canvas | Sidebar */
    gap: 30px;
}

.canvas-container {
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    height: 500px;
    /* Fixed height for canvas area */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.img-container {
    max-width: 100%;
    max-height: 100%;
}

.img-container img {
    max-width: 100%;
}

.canvas-overlay-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.dims-badge {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

/* Sidebar Controls */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-group h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.preset-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: var(--text-muted);
}

.preset-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-wrap {
    flex: 1;
}

.input-wrap label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.input-wrap input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    font-family: monospace;
}

/* Toggles */
.toggles {
    display: flex;
    gap: 20px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.toggle-switch .slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.slider {
    background: var(--primary);
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(16px);
}

.toggle-switch .label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Action Buttons */
.action-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

.icon-btn:hover {
    background: var(--border);
}

.secondary-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
}

.secondary-btn:hover {
    background: var(--border);
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Result View */
.result-view {
    text-align: center;
    padding: 20px;
}

.success-header {
    margin-bottom: 30px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.result-display {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    display: inline-block;
    max-width: 100%;
    margin-bottom: 30px;
}

.result-display img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.download-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto 20px;
}

.info-note {
    font-size: 12px;
    color: var(--text-muted);
}

/* SEO Content */
.seo-content {
    margin-top: 80px;
    padding-bottom: 60px;
}

.content-block {
    max-width: 800px;
    margin: 0 auto 50px;
}

.content-block h2 {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 20px;
    color: #fff;
}

.content-block h3 {
    font-size: 20px;
    margin: 25px 0 15px;
    color: var(--text-main);
}

.text-content p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 16px;
}

.text-content ul,
.text-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
    color: var(--text-muted);
}

.text-content li {
    margin-bottom: 10px;
}

/* Specs Grid (New) */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.spec-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.spec-card h4 {
    color: var(--primary);
    margin-bottom: 10px;
}

.spec-card p {
    font-size: 14px;
    margin-bottom: 0;
}

/* FAQ */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-grid {
    display: grid;
    gap: 20px;
}

.faq-item {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.faq-item:hover {
    border-color: var(--text-muted);
}

.faq-item h4 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 16px;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 0;
}

/* Footer (Updated) */
.main-footer {
    border-top: 1px solid var(--border);
    padding: 80px 0 20px;
    background: #0b101e;
    font-size: 14px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 15px;
}

.brand-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 300px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s;
}

.social-icons a:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748b;
    font-size: 12px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: var(--radius-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .canvas-container {
        height: 350px;
    }

    h1 {
        font-size: 32px;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}