
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border: #dee2e6;
    --accent: #0d6efd;
    --accent-hover: #0b5ed7;
    --shadow: rgba(0, 0, 0, 0.1);
    --canvas-bg: #f0f0f0;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --border: #495057;
    --accent: #0d6efd;
    --accent-hover: #3d8bfd;
    --shadow: rgba(0, 0, 0, 0.3);
    --canvas-bg: #2d2d2d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

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

header {
    background: var(--bg-primary);
    padding: 20px 0;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 30px;
}

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

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.card {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: var(--bg-secondary);
    margin-bottom: 20px;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.upload-btn {
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

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

#upload {
    display: none;
}

.drag-area {
    border: 2px dashed var(--text-secondary);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.drag-area.dragover {
    border-color: var(--accent);
    background-color: rgba(100,100,255,0.1);
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

input[type="color"] {
    width: 100%;
    height: 45px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-secondary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: background 0.3s;
}

.checkbox-label:hover {
    background: var(--bg-tertiary);
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.scale-value {
    color: var(--accent);
    font-weight: 600;
    font-size: 16px;
}

#editorCanvas {
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--canvas-bg);
    cursor: grab;
    display: block;
    margin: 20px auto;
    max-width: 100%;
}

#editorCanvas:active {
    cursor: grabbing;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.platform-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s;
}

.platform-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.custom-sizes-input {
    margin-top: 10px;
    padding: 10px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.custom-sizes-input:focus {
    outline: none;
    border-color: var(--accent);
}

.custom-sizes-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #0b5ed7 100%);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}
.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    background: #9bbbe9 !important; /* soft disabled color */
}

/* Prevent hover effect when disabled */
.generate-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

#output {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    min-height: 100px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.preview-item img {
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow);
}

.preview-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.seo-section {
    background: var(--bg-primary);
    padding: 40px 20px;
    margin-top: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    line-height: 1.7;
}

.seo-section h2, 
.seo-section h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.seo-section p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.seo-section ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.seo-section li {
    margin-bottom: 8px;
    color: var(--text-primary);
}


.site-footer {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 40px 20px 20px;
    margin-top: 40px;
    border-top: 2px solid var(--border);
}


.footer-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 10px;
}

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

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.footer-bottom .powered {
    margin-top: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 600px) {
    .footer-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section ul li {
        justify-content: center;
    }

    .footer-section ul {
        padding: 0;
    }
}


@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .platforms-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.4rem;
    }
}