@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 2rem 1rem;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4facfe, #f093fb);
    border-radius: 5px;
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f093fb, #4facfe);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    padding: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(90deg, #4facfe, #f093fb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: #94a3b8;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.section:hover {
    border-color: rgba(79, 172, 254, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.canvas-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 1rem;
    padding: 1rem;
}

canvas {
    background: transparent;
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: 1rem;
    width: 100%;
    height: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.shape-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.shape-button {
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    transition: all 0.3s ease;
}

.shape-button:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 172, 254, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.shape-button.selected {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.3), rgba(240, 147, 251, 0.3));
    border-color: rgba(79, 172, 254, 0.5);
    color: white;
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

.controls-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    transition: 0.4s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, #4facfe 0%, #f093fb 100%);
    border-color: transparent;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.4s;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(24px);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #f093fb 100%);
    border: 2px solid #1e40af;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(79, 172, 254, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #f093fb 100%);
    border: 2px solid #1e40af;
    cursor: pointer;
}

.input-field {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    width: 80px;
    text-align: center;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: rgba(79, 172, 254, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

input[type="color"] {
    width: 40px;
    height: 40px;
    cursor: pointer;
    border: 2px solid rgba(79, 172, 254, 0.5);
    border-radius: 0.5rem;
    -webkit-appearance: none;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 0.25rem;
}

.gradient-colors-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gradient-color-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-copy, .btn-paste {
    border-radius: 0.25rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 0.75rem;
    border: none;
    transition: all 0.2s;
}

.btn-copy {
    background: rgba(139, 92, 246, 0.8);
}

.btn-copy:hover {
    background: rgba(139, 92, 246, 1);
}

.btn-paste {
    background: rgba(16, 185, 129, 0.8);
}

.btn-paste:hover {
    background: rgba(16, 185, 129, 1);
}

.remove-gradient-color-btn {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border-radius: 0.25rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.remove-gradient-color-btn:hover {
    background: rgba(239, 68, 68, 1);
}

.file-input {
    position: relative;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-input:hover .file-input-label {
    border-color: rgba(79, 172, 254, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

#imageUpload {
    opacity: 0;
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    overflow: hidden;
    z-index: -1;
}

.position-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.select-field {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.625rem;
    color: #e2e8f0;
    cursor: pointer;
    width: 100%;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.select-field:focus {
    outline: none;
    border-color: rgba(79, 172, 254, 0.5);
}

.select-field option {
    background: #1e293b;
    color: white;
}

.btn-primary {
    background: linear-gradient(90deg, #4facfe, #f093fb);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.3), rgba(240, 147, 251, 0.3));
    border: 1px solid rgba(79, 172, 254, 0.4);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.4), rgba(240, 147, 251, 0.4));
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff5252, #e53e3e);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.full-width {
    width: 100%;
}

.hidden {
    display: none !important;
}

.download-section {
    grid-column: 1 / -1;
}

.download-container {
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .main-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .preview-section {
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .container {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    .shape-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .shape-button {
        padding: 0.625rem;
        font-size: 0.8rem;
    }
    
    .position-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .input-field {
        width: 70px;
        font-size: 0.8rem;
    }
}