:root {
    --primary: #64748b;
    --primary-hover: #475569;
    --secondary: #ef4444;
    --dark: #1f2937;
    --light: #f9fafb;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --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);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 40px;
    width: auto;
}

.header h1 {
    font-weight: 600;
    font-size: 1.5rem;
    margin: 0;
    color: white;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.header-actions .btn {
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Language Toggle Button */
#languageToggle {
    min-width: 55px;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

#languageToggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Canvas Container */
.canvas-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 55vh;
    max-height: 65vh;
    position: relative;
}

.canvas-container canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hover Action Buttons */
.hover-action-btn {
    position: fixed;
    background: rgba(30, 41, 59, 0.95);
    color: white;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    min-width: 140px;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hover-action-btn.show {
    opacity: 1;
    pointer-events: auto;
}

/* Specific transforms for different buttons */
.cover-btn.show {
    transform: scale(1);
}

.label-btn.show {
    transform: translate(-50%, -50%) scale(1);
}

.colors-btn.show {
    transform: translate(-50%, -50%) scale(1);
}

.hover-action-btn:hover {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Hover effect with proper transforms */
.cover-btn:hover {
    transform: scale(1.05);
}

.label-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.colors-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.hover-action-btn i {
    font-size: 1rem;
    opacity: 0.9;
}

canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    background-color: #f8f8f8;
    background-image: url('mg-bg.png');
    background-size: 800px;
    background-repeat: repeat;
    opacity: 0.9;
}

/* Color Picker Modal */
.color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.color-picker-modal.active {
    display: flex;
}

.color-picker-content {
    background: rgba(255,255,255,0.8);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    max-width: 1600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 1.5rem;
}

.color-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.color-picker-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--dark);
}

.color-picker-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    margin: 0;
    letter-spacing: 0.02em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: var(--dark);
}

.color-picker-body {
    padding: 1.5rem;
}

.color-section {
    margin-bottom: 2rem;
}

.color-sections-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

.color-separator {
    width: 2px;
    background: linear-gradient(to bottom, #e0e7ef 0%, #b6c2d6 100%);
    border-radius: 2px;
    height: 80%;
    align-self: center;
    margin: 0 1rem;
}

.color-sections-container.wide-layout {
    flex-direction: row;
    justify-content: space-between;
}

.color-sections-container .color-section {
    flex: 1;
    min-width: 300px;
}

.color-section h4 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

/* Pattern Selector */
.pattern-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pattern-btn-group {
    display: flex;
    gap: 0.18rem; /* kisebb távolság */
}

.pattern-btn {
    padding: 0.4rem 1.1rem;
    border-radius: 8px;
    border: none;
    background: #e6e6e6;
    color: #222;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    outline: none;
}

.pattern-btn:hover {
    border-color: #64748b;
    color: #64748b;
}

.pattern-btn.active {
    background: #e3f2fd;   /* világos kék háttér */
    color: #1565c0;        /* sötétkék szöveg */
    border: 1.5px solid #90caf9;
    box-shadow: none;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-item {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    margin: 0;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: #222;
    background-clip: padding-box;
    transition: border 0.2s, box-shadow 0.2s;
}

.color-item:hover {
    transform: scale(1.05);
    border-color: #64748b;
}

.color-item.selected {
    border: 2px solid #0078d7;
    box-shadow: 0 0 0 2px #b3d7ff;
}

.color-item .color-square {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: currentColor;
    border: 1px solid #ccc;
    margin-bottom: 4px;
}

.color-item .color-label {
    font-size: 0.65rem;
    color: #444;
    text-align: center;
    word-break: break-word;
    max-width: 60px;
    line-height: 1.1;
}

/* Effect Controls */
.effect-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #64748b;
    color: white;
}

.btn-primary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--secondary);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: #64748b;
    border: 1px solid #64748b;
}

.btn-outline-primary:hover {
    background: #64748b;
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Modals */
.modal-content {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Color Section Header */
.color-section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 0.5rem;
}

.color-section-header .arrow {
    font-size: 1.1rem;
    color: #90caf9;
}

/* Responsive */
@media (max-width: 768px) {
    .header-actions {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .header-brand {
        justify-content: center;
    }
    
    .color-picker-content {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    
    .pattern-selector {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: 1.25rem;
    }
    
    .header-logo {
        height: 32px;
    }
    
    .canvas-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .color-picker-body {
        padding: 1rem;
    }
    
    .color-picker-header {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .color-picker-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .pattern-btn-group {
        justify-content: flex-start;
    }
}

/* Crop modal optimalizálása */
#cropModal .modal-dialog {
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
}
#cropModal .modal-content {
    max-height: 90vh;
    overflow: auto;
}
#cropImage {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

/* Ez okozza az átlátszóságot */
#colorPickerModal .modal-content,
.color-picker-content {
    background: rgba(255,255,255,1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-radius: 16px;
    padding: 1.5rem;
}

/* Ez a fejléc és gombok új elrendezése */
.color-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.color-picker-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--dark);
}

.color-picker-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    margin: 0;
    letter-spacing: 0.02em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: var(--dark);
}

.color-picker-body {
    padding: 1.5rem;
}

.color-section {
    margin-bottom: 2rem;
}

.color-sections-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

.color-separator {
    width: 2px;
    background: linear-gradient(to bottom, #e0e7ef 0%, #b6c2d6 100%);
    border-radius: 2px;
    height: 80%;
    align-self: center;
    margin: 0 1rem;
}

.color-sections-container.wide-layout {
    flex-direction: row;
    justify-content: space-between;
}

.color-sections-container .color-section {
    flex: 1;
    min-width: 300px;
}

.color-section h4 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

/* Pattern Selector */
.pattern-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pattern-btn-group {
    display: flex;
    gap: 0.18rem; /* kisebb távolság */
}

.pattern-btn {
    padding: 0.4rem 1.1rem;
    border-radius: 8px;
    border: none;
    background: #e6e6e6;
    color: #222;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    outline: none;
}

.pattern-btn:hover {
    border-color: #64748b;
    color: #64748b;
}

.pattern-btn.active {
    background: #e3f2fd;   /* világos kék háttér */
    color: #1565c0;        /* sötétkék szöveg */
    border: 1.5px solid #90caf9;
    box-shadow: none;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-item {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    margin: 0;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: #222;
    background-clip: padding-box;
    transition: border 0.2s, box-shadow 0.2s;
}

.color-item:hover {
    transform: scale(1.05);
    border-color: #64748b;
}

.color-item.selected {
    border: 2px solid #0078d7;
    box-shadow: 0 0 0 2px #b3d7ff;
}

.color-item .color-square {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: currentColor;
    border: 1px solid #ccc;
    margin-bottom: 4px;
}

.color-item .color-label {
    font-size: 0.65rem;
    color: #444;
    text-align: center;
    word-break: break-word;
    max-width: 60px;
    line-height: 1.1;
}

/* Effect Controls */
.effect-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #64748b;
    color: white;
}

.btn-primary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--secondary);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: #64748b;
    border: 1px solid #64748b;
}

.btn-outline-primary:hover {
    background: #64748b;
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Modals */
.modal-content {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Color Section Header */
.color-section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 0.5rem;
}

.color-section-header .arrow {
    font-size: 1.1rem;
    color: #90caf9;
}

/* Responsive */
@media (max-width: 768px) {
    .header-actions {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .header-brand {
        justify-content: center;
    }
    
    .color-picker-content {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    
    .pattern-selector {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: 1.25rem;
    }
    
    .header-logo {
        height: 32px;
    }
    
    .canvas-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .color-picker-body {
        padding: 1rem;
    }
    
    .color-picker-header {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .color-picker-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .pattern-btn-group {
        justify-content: flex-start;
    }
}

/* Crop modal optimalizálása */
#cropModal .modal-dialog {
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
}
#cropModal .modal-content {
    max-height: 90vh;
    overflow: auto;
}
#cropImage {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

/* Additional responsive styles for language toggle */
@media (max-width: 768px) {
    .header-actions {
        gap: 0.2rem !important;
    }
    
    .header-actions .btn {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.7rem !important;
    }
    
    #languageToggle {
        min-width: 45px !important;
        font-size: 0.7rem !important;
        padding: 0.35rem 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .header-actions {
        gap: 0.15rem !important;
    }
    
    .header-actions .btn {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    
    #languageToggle {
        min-width: 40px !important;
        font-size: 0.65rem !important;
        padding: 0.3rem 0.4rem !important;
    }
}

/* Responsive styles for hover buttons */
@media (max-width: 768px) {
    .hover-action-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
        min-width: 100px;
        gap: 0.3rem;
    }
    
    .hover-action-btn i {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .hover-action-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        min-width: 80px;
        gap: 0.25rem;
    }
    
    .hover-action-btn i {
        font-size: 0.75rem;
    }
}

/* Real Images Grid */
.real-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.real-image-item {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-clip: padding-box;
    transition: border 0.2s, box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
    position: relative;
}

.real-image-item:hover {
    transform: scale(1.05);
    border-color: #64748b;
}

.real-image-item.selected {
    border: 3px solid #0078d7;
    box-shadow: 0 0 0 2px #b3d7ff;
}

.real-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.vinyl-label-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background-color: rgba(220, 220, 220, 0.9);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.vinyl-label-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
}

/* Color Picker Footer */
.color-picker-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.8);
    display: flex;
    justify-content: flex-end;
}

.color-picker-footer .btn {
    min-width: 80px;
}
