/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #0a0a0a;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a {
    color: #00d4ff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.nav-logo a:hover {
    color: #ffffff;
}

.nav-container h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 300;
    text-align: center;
    flex: 1;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(45deg, #00d4ff, #0066ff);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #00d4ff;
    border: 2px solid #00d4ff;
}

.btn-secondary:hover {
    background: #00d4ff;
    color: #0a0a0a;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Main Layout */
.editor-container {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    height: calc(100vh - 70px);
    margin-top: 70px;
    gap: 1px;
    background: #0a0a0a;
}

/* Panels */
.tools-panel,
.preview-panel {
    background: #111;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-panel {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas-panel {
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Panel Headers */
.tools-panel h3,
.preview-panel h3 {
    color: #00d4ff;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tool Sections */
.tool-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-section:last-child {
    border-bottom: none;
}

.tool-section h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #00d4ff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: rgba(0, 212, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    background: rgba(0, 212, 255, 0.1);
    border-color: #fff;
}

.upload-area i {
    font-size: 2rem;
    color: #00d4ff;
    margin-bottom: 0.5rem;
    display: block;
}

.upload-area p {
    color: #ccc;
    font-size: 0.9rem;
}

/* Control Groups */
.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    color: #ccc;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Color Input */
.color-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 40px;
    height: 35px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
}

.color-input-group input[type="text"]:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Preset Colors */
.preset-colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.color-preset {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-preset:hover {
    border-color: #00d4ff;
    transform: scale(1.1);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Form Controls */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

select,
input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
}

select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #00d4ff;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
}

#mainCanvas {
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    cursor: grab;
    background: #222;
}

#mainCanvas:active {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
}

.upload-prompt {
    text-align: center;
    color: #fff;
    max-width: 300px;
}

.upload-prompt i {
    font-size: 4rem;
    color: #00d4ff;
    margin-bottom: 1rem;
}

.upload-prompt h3 {
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.upload-prompt p {
    color: #ccc;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Canvas Controls */
.canvas-controls {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.zoom-level {
    color: #ccc;
    font-size: 0.9rem;
    margin-left: auto;
}

/* Preview Container */
.preview-container {
    margin-bottom: 2rem;
}

.preview-item {
    margin-bottom: 1.5rem;
}

.preview-item h4 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.preview-image {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-image canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #666;
}

.preview-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.preview-placeholder p {
    font-size: 0.8rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.quick-action {
    width: 100%;
    margin-bottom: 0.5rem;
    justify-content: flex-start;
}

/* Tips Section */
.tips-section {
    background: rgba(0, 212, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.tips-section h4 {
    color: #00d4ff;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-section ul {
    list-style: none;
}

.tips-section li {
    color: #ccc;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    padding-left: 1rem;
    position: relative;
}

.tips-section li::before {
    content: '•';
    color: #00d4ff;
    position: absolute;
    left: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    text-align: center;
    color: #fff;
}

.loading-spinner i {
    font-size: 3rem;
    color: #00d4ff;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .editor-container {
        grid-template-columns: 280px 1fr 260px;
    }
}

@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .tools-panel,
    .preview-panel {
        max-height: 40vh;
        overflow-y: auto;
    }
    
    .nav-container h1 {
        font-size: 1.2rem;
    }
    
    .preset-colors {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
        flex-wrap: wrap;
        height: auto;
        min-height: 70px;
    }
    
    .nav-container h1 {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        font-size: 1rem;
    }
    
    .tools-panel,
    .preview-panel {
        padding: 15px;
    }
    
    .canvas-controls {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-prompt i {
        font-size: 2.5rem;
    }
    
    #mainCanvas {
        max-width: calc(100vw - 40px);
        max-height: 50vh;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.tool-section {
    animation: slideUp 0.3s ease;
}

.preview-item {
    animation: fadeIn 0.5s ease;
}

/* Scrollbar Styling */
.tools-panel::-webkit-scrollbar,
.preview-panel::-webkit-scrollbar {
    width: 6px;
}

.tools-panel::-webkit-scrollbar-track,
.preview-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.tools-panel::-webkit-scrollbar-thumb,
.preview-panel::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 3px;
}

.tools-panel::-webkit-scrollbar-thumb:hover,
.preview-panel::-webkit-scrollbar-thumb:hover {
    background: #ffffff;
}