/* ==========================================================================
   GEOMETRİ ÇİZİM ARACI - TURKUAZ TEMA & DOKUNMATİK / MOBİL (2 SÜTUN) STİLLERİ
   ========================================================================== */

:root {
    --bg-color: #e0f7fa;
    --panel-bg: rgba(255, 255, 255, 0.94);
    --panel-border: #006064;
    --panel-shadow: 3px 3px 10px rgba(0, 96, 100, 0.2);
    --text-primary: #006064;
    --text-secondary: #00838f;
    --btn-bg: #4dd0e1;
    --btn-border: #006064;
    --btn-hover: #26c6da;
    --btn-active: #00838f;
    --btn-active-text: #ffffff;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    position: fixed; /* Mobilde sayfa kaymasını ve sekmeyi engeller */
}

#mainCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

/* 2 SÜTUNLU YÜZEN ARAÇ ÇUBUĞU (SOL) */
.toolbar {
    position: absolute;
    left: 10px;
    top: 10px;
    display: grid;
    grid-template-columns: repeat(2, 46px);
    gap: 8px;
    z-index: 100;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 6px;
    background-color: rgba(224, 247, 250, 0.75);
    backdrop-filter: blur(4px);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: var(--panel-shadow);
}

.toolbar::-webkit-scrollbar {
    width: 4px;
}
.toolbar::-webkit-scrollbar-thumb {
    background: #006064;
    border-radius: 4px;
}

/* ARAÇ BUTONLARI */
.tool-btn {
    width: 46px;
    height: 46px;
    background-color: var(--btn-bg);
    border: 2px solid var(--btn-border);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--btn-border);
    transition: transform 0.1s, background-color 0.2s, box-shadow 0.1s;
    box-shadow: 2px 2px 0px var(--btn-border);
}

.tool-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.2;
}

.tool-btn:hover {
    background-color: var(--btn-hover);
}

.tool-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px var(--btn-border);
}

.tool-btn.active {
    background-color: var(--btn-active);
    color: #ffffff;
    border-color: #004d40;
    box-shadow: 1px 1px 0px #004d40;
}

/* AYIRAÇ ÇİZGİSİ (2 SÜTUNA YAYILIR) */
.separator {
    grid-column: 1 / -1;
    height: 2px;
    background-color: var(--btn-border);
    opacity: 0.35;
    margin: 2px 0;
    border-radius: 2px;
}

/* RENK SEÇİCİ */
.color-picker-box {
    width: 46px;
    height: 46px;
    background-color: #b2ebf2;
    border: 2px solid var(--btn-border);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 2px 2px 0px var(--btn-border);
    position: relative;
}

.color-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #000000;
}

#colorInput {
    visibility: hidden;
    position: absolute;
    width: 0;
    height: 0;
}

/* KONTROL PANENİ (SOL ALT - BÜYÜTÜLMÜŞ & OKUNAKLI) */
.controls-container {
    position: absolute;
    bottom: 34px;
    left: 14px;
    background-color: var(--panel-bg);
    padding: 16px 20px;
    border-radius: 14px;
    border: 2.5px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 90;
    box-shadow: var(--panel-shadow);
    max-width: 320px;
    width: auto;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.control-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

input[type="range"] {
    width: 150px;
    height: 8px;
    cursor: pointer;
    accent-color: var(--btn-active);
}

select.control-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid var(--panel-border);
    background: #ffffff;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 13.5px;
    outline: none;
    cursor: pointer;
}

/* DURUM ÇUBUĞU (ALT TABAN - MOBİL UYUMLU) */
.status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 28px;
    background-color: #006064;
    color: #e0f7fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 500;
    z-index: 95;
    flex-wrap: wrap;
}

.status-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    white-space: nowrap;
}

/* YARDIM BUTONU */
.help-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--btn-active);
    color: white;
    padding: 6px 14px;
    border-radius: 18px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 110;
    transition: transform 0.1s, background-color 0.2s;
    font-size: 12px;
}

.help-btn:hover { background-color: #006064; }
.help-btn:active { transform: scale(0.95); }

/* MODAL REHBER */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 14px;
    max-width: 480px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    border: 3px solid var(--btn-bg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 2px solid #e0f7fa;
    padding-bottom: 8px;
}

.modal-title { font-size: 18px; font-weight: bold; color: var(--text-primary); }
.close-btn { font-size: 24px; font-weight: bold; cursor: pointer; color: #ef5350; }
.help-item { margin-bottom: 12px; }
.help-title { font-weight: bold; color: var(--btn-active); display: flex; align-items: center; gap: 6px; font-size: 14px; }
.help-desc { font-size: 12px; color: #444; margin-left: 20px; margin-top: 4px; line-height: 1.4; }

/* TOAST */
.toast-container {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: #006064;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid #4dd0e1;
}

/* ==========================================================================
   TELEFON VE TABLET UYUMLULUK DÜZENLEMELERİ (RESPONSIVE MEDIA QUERIES)
   ========================================================================== */

/* AKILLI TELEFONLAR (EKRAN GENİŞLİĞİ < 600px) */
@media screen and (max-width: 600px) {
    .toolbar {
        top: 8px;
        left: 8px;
        grid-template-columns: repeat(2, 40px);
        gap: 6px;
        padding: 4px;
        max-height: calc(100vh - 190px);
    }

    .tool-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .tool-btn svg {
        width: 20px;
        height: 20px;
    }

    .color-picker-box {
        width: 40px;
        height: 40px;
    }

    .color-circle {
        width: 26px;
        height: 26px;
    }

    .controls-container {
        bottom: 30px;
        left: 8px;
        padding: 12px 14px;
        max-width: 270px;
        gap: 8px;
    }

    .control-group label {
        font-size: 12.5px;
    }

    input[type="range"] {
        width: 120px;
    }

    select.control-select {
        font-size: 12px;
        padding: 4px 8px;
    }

    .help-btn {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 11px;
    }

    .status-bar {
        font-size: 10px;
        padding: 2px 6px;
    }

    .status-badge {
        padding: 1px 4px;
        margin-right: 2px;
    }
}

/* TABLETLER (EKRAN GENİŞLİĞİ 601px - 1024px) */
@media screen and (min-width: 601px) and (max-width: 1024px) {
    .toolbar {
        grid-template-columns: repeat(2, 44px);
        gap: 7px;
    }

    .tool-btn {
        width: 44px;
        height: 44px;
    }

    .controls-container {
        max-width: 210px;
    }
}
