/* ===========================================
   COMMON.CSS - Delade stilar for Gallerix poster-editors
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

/* ===========================================
   FONTS - Gotham for poster labels
   =========================================== */
@font-face {
    font-family: 'PD-Gotham-Medium';
    src: url('../fonts/Gotham-Medium.woff') format('woff'), url('../fonts/Gotham-Medium.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PD-Gotham-Light';
    src: url('../fonts/gotham-light-webfont.woff2') format('woff2'), url('../fonts/gotham-light-webfont.woff') format('woff'), url('../fonts/Gotham-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PD-Gotham-Book';
    src: url('../fonts/Gotham Book Regular.otf');
    font-weight: normal;
    font-style: normal;
}

/* ===========================================
   BASE
   =========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #292b2c;
    background-color: #f5f3ec;
    display: flex;
    flex-direction: row-reverse;
    min-height: 100vh;
}

/* ===========================================
   SIDEBAR
   =========================================== */
.sidebar {
    width: 460px;
    min-width: 460px;
    background: #fff;
    padding: 25px 30px;
    overflow-y: auto;
    border-left: 1px solid #e0e0e0;
}

.sidebar h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 25px;
    color: #292b2c;
    text-transform: uppercase;
}

/* ===========================================
   FORM FIELDS
   =========================================== */
.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #87857f;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    background: #fff;
    color: #292b2c;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: #333744;
}

.field input:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Input with button (location + GPS) */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.btn-gps {
    padding: 10px 14px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-gps:hover {
    background: #333744;
}

.btn-gps:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gps-icon {
    width: 16px;
    height: 16px;
}

/* Section titles */
.section-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #87857f;
    margin: 22px 0 10px 0;
    text-transform: uppercase;
}

/* ===========================================
   BUTTONS
   =========================================== */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: rgba(51,55,68,0.7);
    transition: all 0.15s ease-in-out;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    border-color: #999;
}

.btn.active {
    background: #333744;
    color: #fff;
    border-color: #333744;
}

/* Color buttons */
.color-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #d1d1d1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.color-btn:hover {
    border-color: #666;
}

.color-btn.active {
    border-color: #333744;
    box-shadow: 0 0 0 2px #333744;
}

/* Checkbox row */
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    cursor: pointer;
    margin-top: 2px;
}

.checkbox-row label {
    font-size: 11px;
    color: #87857f;
    margin: 0;
    cursor: pointer;
    line-height: 1.4;
}

/* Toggle switches */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #e0e0e0;
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle-row span {
    font-size: 13px;
    color: #292b2c;
}

.toggle {
    width: 48px;
    height: 26px;
    background: #d1d1d1;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.active {
    background: #333744;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle.active::after {
    left: 24px;
}

/* Order button */
.btn-order {
    width: 100%;
    padding: 15px 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-order:hover {
    background: #333744;
}

.btn-order-icon {
    width: 20px;
    height: 20px;
}

/* ===========================================
   PREVIEW AREA
   =========================================== */
.preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #858585;
}

/* ===========================================
   POSTER - Base
   =========================================== */
.poster {
    background: #fff;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.35),
        0 8px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 16px solid #000;
    overflow: hidden;
}

.poster-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Border elements */
.main-border,
.outer-border,
.inner-border {
    position: absolute;
    pointer-events: none;
}

.main-border {
    inset: 0;
    z-index: 2;
}

.outer-border {
    z-index: 3;
}

.inner-border {
    z-index: 4;
}

/* ===========================================
   FRAME STYLES (Passepartout)
   =========================================== */

/* Borderless - Ingen passepartout */
.poster.frame-borderless .main-border,
.poster.frame-borderless .outer-border,
.poster.frame-borderless .inner-border {
    display: none;
}

/* Poster - Vit passepartout utan linjer */
.poster.frame-poster .main-border {
    border: 20px solid #fff;
}

.poster.frame-poster .outer-border,
.poster.frame-poster .inner-border {
    display: none;
}

/* Classic - Vit passepartout med dubbla svarta linjer */
.poster.frame-classic .main-border {
    border: 24px solid #fff;
}

.poster.frame-classic .outer-border {
    inset: 24px;
    border: 2px solid #000;
}

.poster.frame-classic .inner-border {
    inset: 18px;
    border: 4px solid #000;
}

/* ===========================================
   RESPONSIVE - Common
   =========================================== */
@media (max-width: 1200px) {
    .sidebar {
        width: 400px;
        min-width: 400px;
        padding: 20px 25px;
    }
}

@media (max-width: 767px) {
    body {
        flex-direction: column-reverse;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        max-height: none;
    }

    .gps-text {
        display: none;
    }

    .preview-area {
        padding: 25px 15px;
        min-height: 480px;
    }

    .btn-group {
        gap: 6px;
    }

    .btn {
        padding: 8px 10px;
        font-size: 12px;
        line-height: 1.2;
    }

    .color-btn {
        width: 32px;
        height: 32px;
    }

    .btn-order {
        padding: 12px 15px;
        font-size: 13px;
    }
}

@media (max-width: 544px) {
    .preview-area {
        padding: 20px 10px;
        min-height: 400px;
    }

    .sidebar {
        padding: 15px 20px;
    }

    .sidebar h1 {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 11px;
        margin: 18px 0 8px 0;
    }

    .field label {
        font-size: 11px;
    }

    .field input,
    .field select {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-order {
        padding: 12px 15px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .color-btn {
        width: 28px;
        height: 28px;
    }
}
