
/* ===================================
   Image Text Editor - Main Styles
   =================================== */

:root {
    --primary: #087cf0;
    --primary-dark: #0564c5;
    --background: #f4f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #718096;
    --border: #dce4ee;
    --success: #087f5b;
    --radius: 14px;
    --shadow: 0 4px 18px rgba(25, 45, 75, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, "Noto Sans Bengali", sans-serif;
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
label,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

/* Header */

.topbar {
    min-height: 78px;
    padding: 14px 5%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--primary);
    border-radius: 13px;
    font-size: 26px;
    font-weight: 700;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.4px;
}

.brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.status {
    padding: 7px 11px;
    color: var(--success);
    background: #e8f8f0;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Main layout */

.container {
    width: min(1500px, 94%);
    margin: 0 auto;
}

.intro {
    padding: 28px 0 22px;
}

.intro h2 {
    margin: 0 0 7px;
    font-size: clamp(23px, 3vw, 32px);
    letter-spacing: -0.7px;
}

.intro p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.workspace {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

/* Sidebar panels */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel {
    padding: 19px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel h3 {
    margin: 0 0 16px;
    font-size: 16px;
}

.panel label:not(.upload-button) {
    display: block;
    margin: 13px 0 7px;
    font-size: 13px;
    font-weight: 600;
}

.help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* Form fields */

input[type="number"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 76px;
}

input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 124, 240, 0.1);
}

input[type="color"] {
    display: block;
    width: 100%;
    height: 42px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
}

/* Buttons */

.upload-button,
.primary-button,
.secondary-button,
.download-button,
.tool {
    width: 100%;
    min-height: 43px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: background 0.18s, border-color 0.18s;
}

.upload-button {
    color: var(--primary);
    background: #eef6ff;
    border: 1px dashed #80baff;
    cursor: pointer;
}

.upload-button:hover {
    background: #e2efff;
}

.tool {
    margin-bottom: 8px;
    color: #344054;
    background: #ffffff;
    border: 1px solid var(--border);
}

.tool:hover {
    background: #f4f8ff;
}

.tool.active {
    color: var(--primary);
    background: #eef6ff;
    border-color: var(--primary);
}

.primary-button {
    margin-top: 15px;
    color: #ffffff;
    background: var(--primary);
    border: 1px solid var(--primary);
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    margin-bottom: 9px;
    color: #344054;
    background: #ffffff;
    border: 1px solid var(--border);
}

.secondary-button:hover {
    background: #f4f7fb;
}

.download-button {
    color: #ffffff;
    background: #087f5b;
    border: 1px solid #087f5b;
}

.download-button:hover {
    background: #066849;
}

/* Editor */

.editor {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.editor-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 19px 21px;
    border-bottom: 1px solid var(--border);
}

.editor-heading h3 {
    margin: 0;
    font-size: 16px;
}

.editor-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

#imageStatus {
    padding: 6px 10px;
    color: var(--muted);
    background: #f3f5f8;
    border-radius: 20px;
    font-size: 11px;
    white-space: nowrap;
}

.canvas-area {
    position: relative;
    min-height: 470px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px;
    overflow: auto;
    background-color: #edf1f6;
    background-image:
        linear-gradient(45deg, #e1e7ef 25%, transparent 25%),
        linear-gradient(-45deg, #e1e7ef 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e1e7ef 75%),
        linear-gradient(-45deg, transparent 75%, #e1e7ef 75%);
    background-size: 20px 20px;
    background-position:
        0 0, 0 10px, 10px -10px, -10px 0;
}

#imageCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #ffffff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.13);
    touch-action: manipulation;
}

#imageCanvas[hidden] {
    display: none;
}

.empty-state {
    max-width: 330px;
    padding: 20px;
    text-align: center;
}

.upload-symbol {
    width: 65px;
    height: 65px;
    display: grid;
    place-items: center;
    margin: 0 auto 17px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    font-size: 34px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 13px 20px;
    color: var(--muted);
    background: #ffffff;
    font-size: 11px;
    border-top: 1px solid var(--border);
}

footer {
    padding: 25px 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* Keyboard focus */

button:focus-visible,
.upload-button:focus-visible {
    outline: 3px solid rgba(8, 124, 240, 0.35);
    outline-offset: 3px;
}

/* Tablet and mobile */

@media (max-width: 950px) {
    .workspace {
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 15px;
    }

    .canvas-area {
        min-height: 380px;
        padding: 15px;
    }

    .panel {
        padding: 15px;
    }
}

@media (max-width: 700px) {
    .topbar {
        padding: 12px 4%;
    }

    .brand h1 {
        font-size: 17px;
    }

    .brand-icon {
        width: 40px;
        height: 40px;
    }

    .status {
        font-size: 9px;
        padding: 6px 8px;
    }

    .container {
        width: 92%;
    }

    .intro {
        padding: 23px 0 18px;
    }

    .intro p {
        font-size: 13px;
    }

    .workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        order: 2;
    }

    .editor {
        order: 1;
    }

    .canvas-area {
        min-height: 280px;
        padding: 12px;
    }

    .editor-heading {
        padding: 15px;
    }

    .editor-footer {
        padding: 12px 15px;
    }
}

@media (max-width: 380px) {
    .status {
        display: none;
    }

    .editor-heading {
        align-items: flex-start;
    }

    .canvas-area {
        min-height: 240px;
    }
}
