:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #ffffff;
    --surface: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
}

* {
    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 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.125rem;
}

.form-container {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toggle-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    background: var(--background);
    border-radius: 999px;
    font-weight: 500;
    user-select: none;
}

.check-pill input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border);
    background: var(--background);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 100px;
}

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

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

.location-mode {
    display: none;
    margin-top: 1rem;
}

.location-mode.active {
    display: block;
}

.custom-dimensions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.custom-dimensions input {
    flex: 1;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.theme-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--background);
}

.theme-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.theme-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.theme-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.theme-card p {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.theme-palette {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

input[type="range"] {
    width: 100%;
    margin: 1rem 0;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
}

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

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

.preset-label {
    color: var(--text-light);
    font-weight: normal;
    font-size: 0.875rem;
}

.preset-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.preset-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

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

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
}

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

.loading-state {
    text-align: center;
    padding: 3rem;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

.results {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.map-preview {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.error-state {
    background: #fef2f2;
    border: 2px solid var(--error);
    color: var(--error);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.hint {
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.suggestions {
    position: relative;
    margin-top: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    max-height: 240px;
    overflow: auto;
    box-shadow: var(--shadow);
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--surface);
}

.suggestion-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.suggestion-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
}

details {
    margin-top: 1rem;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.5rem;
}

details summary:hover {
    text-decoration: underline;
}

details[open] summary {
    margin-bottom: 1rem;
}

/* Share page styles */
.map-display {
    margin: 2rem 0;
    text-align: center;
}

.map-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.share-info {
    text-align: center;
    margin: 2rem 0;
}

.share-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.share-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.social-share {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.social-share h3 {
    margin-bottom: 1rem;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: transform 0.2s;
}

.social-btn:hover {
    transform: translateY(-2px);
}

.social-btn.twitter {
    background: #1DA1F2;
}

.social-btn.facebook {
    background: #4267B2;
}

.social-btn.pinterest {
    background: #BD081C;
}

.social-btn.reddit {
    background: #FF4500;
}

.embed-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.embed-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.embed-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.embed-tab:hover {
    color: var(--primary-color);
}

.embed-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.embed-code-container {
    margin: 1rem 0;
}

.embed-code {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--background);
    color: var(--text);
    resize: vertical;
}

.embed-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    min-height: 200px;
}

.embed-controls {
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.control-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.control-group label {
    font-weight: 500;
    margin: 0;
}

.control-group select,
.control-group input[type="number"] {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
}

.control-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.control-group input[type="range"] {
    flex: 1;
    max-width: 200px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .share-actions {
        flex-direction: column;
    }
    
    .social-buttons {
        flex-direction: column;
    }
}

/* Gallery styles */
.gallery-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.gallery-filters input,
.gallery-filters select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.gallery-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-card-info {
    padding: 1rem;
}

.gallery-card-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.gallery-card-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}
