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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}



.size-info {
    background: #e8f0fe;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #1a73e8;
}

.btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #bdbdbd;
}

.main {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    margin: 1rem;
    gap: 1rem;
}

 

.sidebar h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem 0;
    color: #555;
}

.sidebar h3:first-of-type {
    margin-top: 0;
}

.mall-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* 3 kolumner */
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mall-card {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #f5f5f5;
}

.mall-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mall-card.active {
    border-color: #1a73e8;
}

.mall-card img {
    width: 100%;
    /*aspect-ratio: 250 / 350;*/
    /*object-fit: cover;*/
    display: block;
    height: 140px
}

.mall-card span {
    display: block;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    background: white;
}

.tool-btn {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.tool-btn:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

.control-group {
    margin: 1rem 0;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.control-group input {
    width: 100%;
}

.control-group span {
    display: inline-block;
    font-size: 0.75rem;
    color: #1a73e8;
    margin-left: 0.5rem;
}

.rotation-buttons {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.rotation-btn {
    flex: 1;
    padding: 0.75rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.2s;
}

.rotation-btn:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

.rotation-btn i {
    margin-right: 0.5rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.small-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    text-align: center;
        height: 46px;

}

.small-btn:hover {
    background: #e8f0fe;
}

.canvas-area {
    flex: 1;
    background: #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 2rem;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
}

#editorCanvas {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    background: white;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

.info-box {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #e8f0fe;
    border-radius: 8px;
    font-size: 0.7rem;
    color: #1a73e8;
}

.info-box i {
    margin-right: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}


/* Lägg till i slutet av style.css */

/* Modal för upplösningsvarning */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-content h2 {
    padding: 1.5rem 1.5rem 0 1.5rem;
    margin: 0;
}

.modal-content .close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-content .close-modal:hover {
    color: #333;
}

#resolutionModalBody {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

#closeResolutionModal {
    margin: 0 1.5rem 1.5rem 1.5rem;
    width: calc(100% - 3rem);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Warning notification style */
.notification.warning {
    background: #ffc107;
    color: #333;
}

.notification.error {
    background: #dc3545;
}

/* Lägg till i style.css */

.divider {
    height: 1px;
    background: #e0e0e0;
    margin: 1rem 0;
}

#textTools {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

#textTools .control-group {
    margin: 0.75rem 0;
}

#textColorPicker {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
}

#fontFamilySelect {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
}

#fontSizeSlider {
    width: calc(100% - 50px);
    display: inline-block;
}

#fontSizeValue {
    display: inline-block;
    width: 45px;
    text-align: right;
}


/* Lägg till i style.css */

.small-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.rotation-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

#textTools {
    transition: all 0.3s ease;
}

/* Lägg till i style.css - Större textverktyg */

#fontSizeSlider {
    width: calc(100% - 60px);
    display: inline-block;
}

#fontSizeValue {
    display: inline-block;
    width: 55px;
    text-align: right;
    font-weight: bold;
    color: #1a73e8;
}

/* Gör textens kontrollpunkter större */
.canvas-container .upper-canvas {
    cursor: pointer;
}

/* Förbättra textredigering */
.fabric-textbox {
    cursor: text;
}


/* Export buttons styling */
.export-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.format-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.format-select, .quality-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
}
/* Lägg till i style.css */

.text-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
/*     width: auto;
    min-width: 200px;
    max-width: 100%;*/
}

.text-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.text-input:hover {
    border-color: #1a73e8;
}


.format-select:hover, .quality-select:hover {
    border-color: #1a73e8;
}

.export-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.export-buttons .btn i {
    margin-right: 0.25rem;
}



@media (max-width: 768px) {
    .export-buttons {
        flex-wrap: wrap;
    }
    
    .format-selector {
        width: 100%;
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    .format-select, .quality-select {
        flex: 1;
    }
}
/* ============ ACCORDION STYLING - SCROLL I VARJE ITEM ============ */

/* Sidofältet - INGEN scroll här */
.sidebar {
width: 380px;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Accordion container - fyller sidofältet */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;  /* Lätt scroll om många items, men inte nödvändigt */
}

/* Accordion item */
.accordion-item {
    border: 2px solid #ffc107;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.accordion-header {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: bold;
    background: #ffc107;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;  /* Header ska inte scrolla */
}

.accordion-header i {
    font-size: 1rem;
}

.accordion-header::after {
    content: '❯';
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.accordion-item.open .accordion-header::after {
    transform: rotate(90deg);
}

/* ============ VIKTIGT: SCROLL I ACCORDION-CONTENT ============ */
.accordion-content {
    max-height: 0;
    overflow-y: hidden;  /* Dold när stängd */
    transition: max-height 0.3s ease;
    background: #fff;
}

.accordion-item.open .accordion-content {
    max-height: 350px;  /* Fast höjd, scroll om innehållet är längre */
    overflow-y: auto;   /* Scroll vid behov */
}

.accordion-content-inner {
    padding: 12px 16px;
    font-size: 20px;
    border-top: 1px solid #eee;
}

.small-btn .danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.small-btn .danger:hover {
    background: #c82333;
}

/* Om du vill ha dynamisk höjd baserad på fönsterstorlek */
@media (min-height: 800px) {
    .accordion-item.open .accordion-content {
        max-height: 450px;
    }
}

@media (min-height: 1000px) {
    .accordion-item.open .accordion-content {
        max-height: 550px;
    }
}



/* Lägg till i style.css */

#textFontSize {
    width: calc(100% - 60px);
    display: inline-block;
}

#textFontSizeValue {
    display: inline-block;
    width: 55px;
    text-align: right;
    font-weight: bold;
    color: #1a73e8;
}

.small-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}


textarea.text-input {
    resize: vertical;
    font-family: 'Inter', sans-serif;
}

/*******************************************************************/
/* Effektkontroller */
.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#textStrokeColor,
#textShadowColor {
    width: 45px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

#textShadowBlur,
#textShadowOffsetX,
#textShadowOffsetY {
    width: 80px;
}

h4 {
    font-size: 0.9rem;
    margin: 0.75rem 0 0.5rem 0;
    color: #555;
}

.divider {
    height: 1px;
    background: #e0e0e0;
    margin: 1rem 0;
}

.format-select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.format-select:hover {
    border-color: #1a73e8;
}

/* Lägg till i style.css */
#textLineHeight {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

#textLineHeight::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: none;
}

#textLineHeightValue {
    font-weight: 600;
    color: #1a73e8;
}