* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #fd79a8;
    --success-color: #00b894;
    --dark-bg: #1a1a1a;
    --light-bg: #f8f9fa;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Header Styles - Enhanced */
.site-header {
    color: black;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid black;
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    min-height: 80px;
border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-2px);
}

.logo img {
    height: auto;
    width: auto;
    border-radius: 8px;
   
    transition: var(--transition);
}
.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: black;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: black;
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}
/* Typography */
h1 {
     margin-top: 1rem;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    margin-bottom: 0.5rem;
    text-align: center;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 0.5rem;
}

h3 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 3rem;
    padding-left: 40px;
    padding-right: 40px;
     text-align: center;
}


/* Main Container and Layout - Unchanged */
.main-container {
    max-width: 1300px;
    margin: 0 auto;
    backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow: hidden;
    min-height: calc(100vh - 20px);
    margin-top: 20px;
    margin-bottom: 20px;
}

.app-layout {
    max-width: 1260px;
    width: min(1260px, 100%); /* Use min() for better responsiveness */
    margin: 0 auto; /* This centers the layout horizontally */
    display: grid;
    grid-template-areas: 
        "left-tools canvas-area right-tools"
        "controls controls controls";
    grid-template-columns: minmax(200px, 250px) 1fr minmax(200px, 250px);
    grid-template-rows: 1fr auto;
    min-height: calc(100vh - 20px);
    gap: 0;
    border-radius: 24px;
    border: 2px solid rgb(103, 95, 148);
}
.left-panel {
    grid-area: left-tools;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
}

.right-panel {
    grid-area: right-tools;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
}

.canvas-area {
    grid-area: canvas-area;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 500px;
}
.controls-area {
    grid-area: controls;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
}

.tool-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.tool-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.tool-btn:hover::before {
    left: 100%;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.tool-btn.active {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 184, 148, 0.4);
}

.canvas-container {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas {
    display: block;
    cursor: crosshair;
    border-radius: 16px;
    max-width: 100%;
    max-height: 100%;
    touch-action: none;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.15;
    border-radius: 16px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.color-swatch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.color-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.color-swatch.active {
    border-color: #333;
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.color-swatch.active::after {
    width: 8px;
    height: 8px;
}

.speed-controller {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
}

.speed-label {
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.speed-slider {
    width: 200px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    position: relative;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.speed-display {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

.rewrite-btn {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 8px 25px rgba(253, 121, 168, 0.4);
    position: relative;
    overflow: hidden;
}

.rewrite-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.rewrite-btn:hover::before {
    left: 100%;
}

.rewrite-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(253, 121, 168, 0.6);
}

.rewrite-btn:active {
    transform: translateY(-1px);
}

.utility-group {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.utility-btn {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.utility-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 184, 148, 0.4);
}

.bg-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bg-option {
    width: 100%;
    height: 45px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bg-option::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bg-option:hover::after {
    opacity: 1;
}

.bg-option:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.bg-option.active {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.options-panel {
    background: rgba(255, 255, 255, 0.8);
    padding: 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Footer Styles - Enhanced */
.site-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    padding: 3rem 0 1rem;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #fd79a8 100%);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-column {
    position: relative;
}

.footer-column h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    position: relative;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.footer-column p {
    line-height: 1.8;
    font-size: 0.95rem;
    color: #b0b0b0;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-radius: 50%;
    font-size: 1.1rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.quick-links {
    list-style: none;
}

.quick-links li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1rem;
}

.quick-links li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    transition: var(--transition);
}

.quick-links a {
    color: #b0b0b0;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.quick-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.quick-links a:hover {
    color: white;
    padding-left: 0.5rem;
}

.quick-links a:hover::after {
    width: 100%;
}

.quick-links li:hover::before {
    transform: translateX(3px);
    color: var(--accent-color);
}

.contact-info {
    list-style: none;
}

.contact-info li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #b0b0b0;
    transition: var(--transition);
}

.contact-info li:hover {
    color: white;
    transform: translateX(5px);
}

.contact-info i {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 0.2rem;
    width: 20px;
    text-align: center;
    transition: var(--transition);
}

.contact-info li:hover i {
    color: var(--accent-color);
    transform: scale(1.2);
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.copyright::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.copyright p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    transition: var(--transition);
    text-align: center;
}

.copyright:hover p {
    color: #b0b0b0;
    
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-areas: 
            "canvas-area"
            "controls"
            "left-tools"
            "right-tools";
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto auto auto;
    }
    
    .left-panel, .right-panel {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tool-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .bg-selector {
        flex-direction: row;
    }
    
    .bg-option {
        height: 35px;
        min-width: 60px;
    }
    
    .color-grid {
        grid-template-columns: repeat(10, 1fr);
        justify-items: center;
    }
    
    .speed-slider {
        width: 150px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    body {
        padding: 0;
    }
    
    .main-container {
        min-height: calc(100vh - 10px);
        border-radius: 16px;
        margin: 10px;
    }
    
    .left-panel, .right-panel {
        padding: 15px;
    }
    
    .canvas-area {
        padding: 15px;
        min-height: 400px;
    }
    
    .controls-area {
        padding: 15px;
        gap: 20px;
    }
    
    .color-swatch {
        width: 28px;
        height: 28px;
    }
    
    .rewrite-btn {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .speed-slider {
        width: 120px;
    }

    .footer-container {
        padding: 0 1rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.25rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .controls-area {
        flex-direction: column;
        gap: 15px;
    }
    
    .color-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .color-swatch {
        width: 24px;
        height: 24px;
    }
    
    .utility-group {
        flex-direction: column;
    }
    
    .options-panel {
        padding: 12px;
    }

    .quick-links li {
        padding-left: 0;
    }
    
    .quick-links li::before {
        display: none;
    }
    
    .contact-info li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
article {
            background: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        h2 {
            color: #2c3e50;
            border-bottom: 3px solid #3498db;
            padding-bottom: 10px;
            margin-top: 30px;
            margin-bottom: 20px;
        }
        
        h2:first-of-type {
            margin-top: 0;
        }
        
        section {
            margin-bottom: 30px;
        }
        
        p {
            margin-bottom: 15px;
            text-align: justify;
        }
        
        .highlight {
            background-color: #e8f6f3;
            padding: 15px;
            border-left: 4px solid #16a085;
            margin: 20px 0;
            border-radius: 4px;
        }
        
        .tip {
            background-color: #fef9e7;
            padding: 15px;
            border-left: 4px solid #f39c12;
            margin: 20px 0;
            border-radius: 4px;
        }
        
        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin: 20px 0;
        }
        
        .feature-item {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            border: 1px solid #e9ecef;
        }
        
        .feature-item strong {
            color: #2c3e50;
            display: block;
            margin-bottom: 8px;
        }
        
        .security-note {
            background-color: #e8f5e8;
            padding: 15px;
            border-left: 4px solid #27ae60;
            margin: 20px 0;
            border-radius: 4px;
        }
        
        .tools-section {
            background-color: #f4f6f9;
            padding: 20px;
            border-radius: 8px;
            margin: 20px 0;
        }