/* Global Styles */
:root {
    /* Main Theme Colors */
    --bg-light-blue: #e6f0ff;
    --primary-blue: #4a90e2;
    --secondary-blue: #357abd;
    --glass-white: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-dark: #000000;
    --text-light: #333333;
    --mc-green: #22c55e;
    --mc-orange: #f97316;
    --mc-purple: #8b5cf6;
    --mc-blue: #3b82f6;
    --mc-red: #ef4444;
    
    /* Original Colors */
    --original-bg: #3c67a3;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light-blue);
    color: #000000;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
}



/* Scrollbar */
::-webkit-scrollbar { 
    width: 10px; 
}
::-webkit-scrollbar-track { 
    background: #1f2937; 
}
::-webkit-scrollbar-thumb { 
    background: #22c55e; 
    border-radius: 5px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: #16a34a; 
}

/* MapArt Generator Component Styles */
.image-uploader {
    margin-bottom: 2rem;
}

.upload-zone {
    border: 3px dashed rgba(102, 126, 234, 0.5);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.upload-zone.drag-over {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.2);
    transform: scale(1.02);
}

.upload-zone.has-image {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.upload-icon,
.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-content h3,
.upload-success h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #000000;
}

.file-input {
    display: none;
}

.upload-content p,
.upload-success p {
    color: #888;
    font-size: 0.9rem;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-zone:hover::before {
    left: 100%;
}

.image-settings {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.setting-input,
.setting-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    color: #535353;
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

.setting-input:focus,
.setting-select:focus {
    outline: none;
    border-color: #667eea;
}

.setting-select {
    width: 120px;
}

.setting-range {
    flex: 1;
    margin: 0 0.5rem;
    cursor: pointer;
}

.setting-value {
    min-width: 40px;
    text-align: right;
    color: #667eea;
    font-weight: 700;
}

.setting-hint {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.generate-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.generate-button:active {
    transform: translateY(0);
}

.block-selector {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #ddd;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.block-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.category-header {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
}

.category-header label {
    flex: 1;
    color: #e0e0e0;
    font-weight: 500;
    cursor: pointer;
}

.block-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.4rem;
    padding: 0.5rem;
}

.block-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-align: center;
}

.block-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.block-item.selected {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.block-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.block-name {
    font-size: 0.7rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    word-wrap: break-word;
}

.selected-count {
    margin-top: 0.8rem;
    padding: 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    text-align: center;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.image-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.preview-modes {
    display: flex;
    gap: 0.5rem;
}

.mode-button {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.mode-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mode-button.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
}

.preview-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    overflow: auto;
    position: relative;
}

.preview-canvas {
    max-width: 100%;
    max-height: 500px;
    image-rendering: pixelated;
}

.preview-placeholder {
    text-align: center;
    color: #666;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.preview-info {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    gap: 0.5rem;
}

.info-label {
    color: #888;
    font-size: 0.9rem;
}

.info-value {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
}

.block-statistics {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.statistics-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.total-blocks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.total-label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.total-value {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1rem;
}

.block-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.block-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.export-button {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.export-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.export-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

.export-btn:active:not(:disabled) {
    transform: translateY(0);
}

.export-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.export-btn.loading {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.btn-icon,
.btn-spinner {
    font-size: 1.2rem;
}

.btn-text {
    flex: 1;
}

.export-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.info-title {
    color: #333;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    color: #888;
    font-size: 0.8rem;
    padding: 0.25rem 0 0.25rem 1rem;
    position: relative;
}

.info-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4ade80;
}

.progress-bar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 1.5rem;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-label {
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 500;
}

.progress-percentage {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 700;
}

.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-indicator {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-status {
    margin-top: 0.5rem;
    color: #888;
    font-size: 0.85rem;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #333;
    font-size: 1rem;
}

.provider {
    color: #667eea;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.provider a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px dashed #667eea;
    transition: all 0.3s ease;
}

.provider a:hover {
    color: #764ba2;
    border-bottom-style: solid;
}

.main {
    flex: 1;
    padding: 2rem;
    max-width: 100vw;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.footer p {
    color: #888;
    font-size: 0.9rem;
    margin: 0.3rem 0;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #764ba2;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(250px, 0.8fr) 1fr minmax(250px, 0.8fr);
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    box-sizing: border-box;
}

.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    overflow-x: auto;
}

.center-panel {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 0;
    overflow-x: auto;
}

@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .left-panel,
    .right-panel {
        order: 2;
    }
    
    .center-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .main {
        padding: 1rem;
    }
}