:root {
    /* Light Theme Colors */
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --button-bg: #f3f4f6;
    --button-hover-bg: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-color: #e3f2fd;
    --accent-color: #FF6B6B;
    --gradient-start: #4F46E5;
    --gradient-end: #FF6B6B;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --primary-color: #60a5fa;
    --secondary-color: #3b82f6;
    --text-primary: #f9fafb;
    --text-secondary: #94a3b8;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --border-color: #374151;
    --button-bg: #374151;
    --button-hover-bg: #4b5563;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-color: #1e293b;
    --accent-color: #7928CA;
    --gradient-start: #7928CA;
    --gradient-end: #FF0080;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}

/* Theme Switch */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle input {
    display: none;
}

.theme-toggle label {
    width: 48px;
    height: 24px;
    background-color: var(--button-bg);
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.theme-toggle label::before {
    content: "🌙";
    font-size: 14px;
}

.theme-toggle label::after {
    content: "☀️";
    font-size: 14px;
}

.theme-toggle label span {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.theme-toggle input:checked + label span {
    transform: translateX(24px);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Header Styles */
.header {
    background: var(--bg-primary);
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(45deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .logo h1 {
    background: linear-gradient(45deg, #60a5fa, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-primary);
    opacity: 0.8;
}

/* Upload Section */
.upload-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: var(--hover-color);
}

.drop-zone i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px var(--shadow-color);
}

/* Preview Container */
.preview-container {
    display: none;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.image-preview {
    flex: 1;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.image-preview h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Tool Buttons */
.tools {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.tool-button {
    padding: 10px 20px;
    background: var(--button-bg);
    border: none;
    border-radius: 5px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.tool-button:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
}

.tool-button i {
    font-size: 1.1em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    margin: 0;
}

.close {
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Background Options */
.bg-section {
    margin-bottom: 2rem;
}

.bg-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.bg-option {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.transparent-bg {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
                      linear-gradient(-45deg, #ccc 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #ccc 75%),
                      linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.color-picker {
    text-align: center;
}

.color-picker input[type="color"] {
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.color-picker label {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

/* Effects Grid */
.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.effect-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.effect-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

/* Spinner Animation */
.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.circle-border {
    width: 80px;
    height: 80px;
    padding: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: linear-gradient(0deg, rgba(63,249,220,0.1) 33%, rgba(63,249,220,1) 100%);
    animation: spin 0.8s linear 0s infinite;
}

.circle-core {
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    border-radius: 50%;
}

.loading-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    animation: titlePulse 1.5s ease-in-out infinite;
}

/* Progress Bar */
.loading-progress {
    margin-top: 1.5rem;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.status {
    display: inline-block;
    position: relative;
    padding-right: 1.5rem;
}

.status::after {
    content: '...';
    position: absolute;
    right: 0;
    animation: ellipsis 1.5s infinite;
}

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 8px;
    width: 0%;
    animation: progressFill 2s ease-in-out infinite;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes titlePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .loading {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .loading-content {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .circle-border {
    background: linear-gradient(0deg, rgba(123,90,224,0.1) 33%, rgba(123,90,224,1) 100%);
}

/* About Page Styles */
.about-page,
.policy-page,
.terms-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.about-hero,
.policy-hero,
.terms-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.about-hero h1,
.policy-hero h1,
.terms-hero h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-content,
.policy-content,
.terms-content {
    display: grid;
    gap: 2rem;
}

.about-section,
.policy-section,
.terms-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.about-section h2,
.policy-section h2,
.terms-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-section ul,
.policy-section ul,
.terms-section ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-top: 1rem;
}

.about-section ul li,
.policy-section ul li,
.terms-section ul li {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--button-bg);
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--secondary-color);
}

/* Download Container and Button */
.download-container {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    animation: fadeInUp 0.5s ease forwards;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.download-btn i {
    font-size: 1.1rem;
}

.download-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

/* Download button animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .download-btn {
    background: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

[data-theme="dark"] .download-btn:hover {
    background: #1e88e5;
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.3);
}

/* Animations */
@keyframes modalSlideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .preview-container {
        flex-direction: column;
    }

    .tools {
        flex-direction: column;
    }

    .tool-button {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .about-hero h1,
    .policy-hero h1,
    .terms-hero h1 {
        font-size: 2rem;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .about-hero h1,
    .policy-hero h1,
    .terms-hero h1 {
        font-size: 2rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

#eraseCanvas {
    display: none;
}

/* Hero Heading Section */
.hero-heading {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.main-title {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 700;
    font-size: 4rem;
    background: linear-gradient(45deg, var(--gradient-start) 30%, var(--gradient-end) 70%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    position: relative;
    animation: titleReveal 1.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.5s forwards;
}

.badge {
    background: linear-gradient(45deg, var(--gradient-start), var(--accent-color));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    transform: rotate(-2deg);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Light theme specific styles */
:root .main-title {
    background: linear-gradient(45deg, #4F46E5 30%, #FF6B6B 70%);
    -webkit-background-clip: text;
    background-clip: text;
}

:root .badge {
    background: linear-gradient(45deg, #4F46E5, #FF6B6B);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Dark theme specific styles remain unchanged */
[data-theme="dark"] .main-title {
    background: linear-gradient(45deg, #7928CA 30%, #FF0080 70%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="dark"] .badge {
    background: linear-gradient(45deg, #7928CA, #FF0080);
    box-shadow: 0 4px 12px rgba(255, 0, 128, 0.2);
}

/* Animations */
@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.8rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
}
