/* Genel Stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    color: #333;
}

.container-full {
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
    flex-shrink: 0;
}

/* Edit modda header'ı gizle */
header.hidden {
    display: none;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Upload Section */
.upload-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 30px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #667eea;
    stroke-width: 2;
}

.upload-area h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 5px;
    font-size: 1rem;
}

.file-info {
    font-size: 0.9rem;
    color: #999;
    margin-top: 10px;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    pointer-events: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

/* Processing Section */
.processing-section {
    margin: 30px 0;
}

.progress-container {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

.progress-text {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 500;
}

/* Preview Section */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Editor Topbar */
.editor-topbar {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.info-display {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.info-badge {
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
    border: 1px solid #e9ecef;
}

.info-badge strong {
    color: #667eea;
    margin-right: 5px;
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.settings-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-group label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.toolbar-input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.9rem;
}

.toolbar-unit {
    font-size: 0.85rem;
    color: #999;
}

.topbar-right {
    display: flex;
    gap: 10px;
}

/* Editor Layout */
.editor-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 0;
    min-height: 0;
    overflow: hidden;
}

.editor-palette {
    background: #f8f9fa;
    border-right: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.editor-main {
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-controls {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 10px 15px;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.grid-size-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.grid-size-controls > label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
}

.grid-size-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.grid-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-input-group label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.grid-size-input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.9rem;
}

.grid-unit {
    font-size: 0.85rem;
    color: #999;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.zoom-controls > label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
}

.zoom-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #667eea;
}

.zoom-hint {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
    margin: 0;
    margin-top: 5px;
}

.editor-tools {
    background: #f8f9fa;
    border-left: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-wrapper {
    flex: 1;
    padding: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    position: relative;
    cursor: grab;
}

.preview-wrapper:active {
    cursor: grabbing;
}

.preview-svg-container {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-svg-container svg {
    border: 1px solid #e9ecef;
    border-radius: 5px;
    display: block;
    flex-shrink: 0;
    transition: transform 0.1s ease-out;
    background: repeating-conic-gradient(#f8f8f8 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
}

.preview-wrapper svg rect {
    transition: opacity 0.2s ease;
}

.preview-wrapper svg rect:hover {
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

/* Tools Panel */
.tools-panel {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.tools-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.tool-section {
    margin-bottom: 20px;
}

.tool-section label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.mode-buttons {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mode-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.mode-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.color-hex-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: monospace;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
}

.color-hex-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.undo-redo-group {
    margin-top: 10px;
}

.undo-redo-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon-text {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-icon-text span {
    font-size: 1.2rem;
}

.btn-icon-text:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon-text:disabled:hover {
    transform: none;
    box-shadow: none;
}


.color-palette-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.color-palette-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.color-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 0;
}

.color-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.color-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.color-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.color-swatch-wrapper {
    position: relative;
    flex-shrink: 0;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-item-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 35px;
    height: 35px;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
}

.color-item-hex {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: monospace;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.color-item-hex:focus {
    outline: none;
    border-color: #667eea;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #e9ecef;
}

.color-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.color-count {
    font-weight: 500;
}

.no-colors {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

.palette-actions {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design Updates */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
    
    .editor-right {
        order: -1;
    }
    
    .color-palette-panel {
        max-height: 400px;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .editor-layout {
        grid-template-columns: 240px 1fr 240px;
    }
}

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 200px 1fr 200px;
    }
    
    .editor-topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
    }
    
    .topbar-center {
        justify-content: flex-start;
    }
    
    .settings-toolbar {
        flex-wrap: wrap;
    }
    
    .color-item-header {
        flex-wrap: wrap;
    }
    
    .color-item-hex {
        min-width: 80px;
    }
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #dc3545;
    font-weight: 500;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 20px 15px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        width: 60px;
        height: 60px;
    }

    .preview-info {
        flex-direction: column;
    }

    .info-item {
        margin: 15px 0;
    }

    .action-buttons {
        display: flex;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-section {
    animation: fadeIn 0.5s ease;
}

/* Scrollbar Styling */
.preview-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.preview-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.preview-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.preview-wrapper::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

