:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --accent-color: #ff6b6b;
    --text-color: #333333;
    --background-color: #ffffff;
    --sidebar-color: #f5f7fa;
    --border-color: #e1e4e8;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --button-text: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 4px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-color);
    transition: var(--transition);
}

header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow);
}

header .search-container {
    max-width: 500px;
    margin: 1rem auto 0;
    display: flex;
    position: relative;
}

header #search-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

header #search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    color: #666;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

.container {
    display: flex;
    max-width: 1920px;
    margin: 0 auto;
    min-height: calc(100vh - 150px);
}

.sidebar {
    width: 350px;
    background-color: var(--sidebar-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    height: calc(100vh - 150px);
    position: sticky;
    top: 0;
}

.configuration-panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.configuration-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.colors {
    margin-top: 1rem;
}

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

.color-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.color-input span {
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="color"] {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    background-color: #f5f7fa;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn:hover {
    background-color: #eaeef2;
}

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

.btn-primary:hover {
    background-color: #3a80d2;
    border-color: #3a80d2;
}

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

.btn-success:hover {
    background-color: #218838;
    border-color: #218838;
}

.preview-section {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    position: relative;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.preview-frame-container {
    position: relative;
    height: calc(100vh - 240px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #f5f7fa;
    border-bottom: 1px solid var(--border-color);
}

.device-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.device-btn svg {
    fill: #666;
    transition: var(--transition);
}

.device-btn.active {
    background-color: rgba(74, 144, 226, 0.1);
}

.device-btn.active svg {
    fill: var(--primary-color);
}

#preview-iframe {
    width: 100%;
    height: calc(100% - 60px);
    border: none;
    background-color: white;
    transition: var(--transition);
}

#preview-iframe.desktop {
    width: 100%;
}

#preview-iframe.tablet {
    width: 768px;
    margin: 0 auto;
    display: block;
}

#preview-iframe.mobile {
    width: 375px;
    margin: 0 auto;
    display: block;
}

.code-container {
    display: flex;
    height: calc(100vh - 240px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.code-sidebar {
    width: 220px;
    background-color: #f5f7fa;
    border-right: 1px solid var(--border-color);
    padding: 1rem 0;
    overflow-y: auto;
}

.code-folder {
    margin-bottom: 0.5rem;
}

.folder-name {
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.folder-toggle {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    transition: var(--transition);
}

.folder-files {
    padding-left: 2rem;
}

.file {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

.file.active {
    background-color: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.code-editor {
    flex: 1;
    background-color: #fff;
    overflow-y: auto;
    position: relative;
}

#code-display {
    padding: 1rem;
    margin: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.images-gallery {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: 400px;
}

.no-images {
    text-align: center;
    color: #666;
    margin-top: 3rem;
}

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

.image-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

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

.image-info {
    padding: 0.75rem;
    background-color: #f5f7fa;
    border-top: 1px solid var(--border-color);
}

.image-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.image-type {
    font-size: 0.8rem;
    color: #666;
}

.profile-header, .wishlist-header, .cart-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-section, .wishlist-item, .cart-item {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.order-item, .wishlist-item {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.express-payment-buttons {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shopify-payment-button__button {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background-color: white;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.shopify-payment-button__button--branded {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.cart-summary {
    padding: 1.5rem;
    background-color: var(--light-background);
    border-radius: var(--border-radius);
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #f5f7fa;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    max-width: 600px;
    width: 90%;
    margin: 50px auto;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-modal:hover {
    background-color: #f5f7fa;
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.image-result {
    margin-top: 1.5rem;
    text-align: center;
}

#image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#image-result-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .preview-frame-container,
    .code-container {
        height: 600px;
    }
}

@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .color-inputs {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .cart-footer {
        grid-template-columns: 1fr;
    }
}