
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #1e293b;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.5);
    --border: #334155;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #22c55e;
    --error: #ef4444;
    --gradient-start: #818cf8;
    --gradient-end: #c084fc;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

/* Upload Section */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface);
    backdrop-filter: blur(10px);
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Editor Section */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.controls {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

select, input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

select:hover, input[type="number"]:hover {
    border-color: var(--primary);
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--text);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

/* Aspect Ratio Control */
.aspect-ratio-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.aspect-ratio-control input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
}

/* Buttons */
.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

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

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Preview Section */
.preview-section {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-box {
    aspect-ratio: 16/9;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-box p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    font-size: 0.9rem;
}

.image-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-box {
    background: rgba(30, 41, 59, 0.8);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.info-box span:first-child {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.info-box span:last-child {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    background: var(--success);
    color: white;
    border-radius: 0.5rem;
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast.error {
    background: var(--error);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .editor-container {
        grid-template-columns: 1fr;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .image-info {
        grid-template-columns: 1fr;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Content Section */
.content-section {
    margin-top: 3rem;
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.content-section h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.content-section ul {
    list-style-position: inside;
    margin: 1rem 0;
    color: var(--text-secondary);
}

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

/* Footer */
footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s ease;
}

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