:root {

    --primary-color: #2c3e50;

    --secondary-color: #3498db;

    --accent-color: #e74c3c;

    --light-color: #ecf0f1;

    --dark-color: #34495e;

    --success-color: #2ecc71;

    --warning-color: #f39c12;

}



/* DÜZENLEME: Temel esneklik için eklendi */

html, body {

    height: 100%;

    overflow: hidden; /* Sayfanın kaydırma çubuğu olmasını engelle */

}



* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

}



body {

    background-color: #f5f7fa;

    color: #333;

    line-height: 1.5;          /* <<< OKUNABİLİRLİK İÇİN 1.6 yerine 1.5 */

    font-size: 14px;           /* <<< TEMEL FONT BOYUTU (14px veya 15px deneyin) */

    line-height: 1.6;

    display: flex;

    flex-direction: column;

    /* DÜZENLEME: min-height yerine height kullanıldı */

    height: 100vh;

}



/* style.css içine YENİ kurallar olarak ekleyin */

h1, .h1 { /* Ana başlık (Header) */

    font-size: 1.4rem; /* Temel font boyutuna göre 1.4 kat */

    font-weight: 600;

    margin: 0; /* Header içinde ekstra boşluk olmasın */

    line-height: 1.2;

}



h3, .h3 { /* Panel başlıkları için genel */

    font-size: 1rem; /* Temel font boyutuyla aynı, ama kalın */

    font-weight: 600;

    color: var(--primary-color, #2c3e50); /* Koyu renk */

    margin-bottom: 0.8rem; /* Alt boşluk */

    padding-bottom: 0.4rem; /* Altına ince çizgi için boşluk */

    border-bottom: 1px solid #e0e0e0; /* Ayırıcı çizgi */

    line-height: 1.3;

}



/* Header Styles */

header {

    background-color: var(--primary-color);

    color: white;

    padding: 1rem;

    box-shadow: 0 2px 5px rgba(0,0,0,0.1);

    /* DÜZENLEME: Header'ın küçülmesini engelle */

    flex-shrink: 0;

}



.header-content {

    display: flex;

    justify-content: space-between;

    align-items: center;

    max-width: 100%;

    margin: 0 auto;

}



.logo h1 {

    font-size: 1.5rem;

    font-weight: 600;

}



.user-actions {

    display: flex;

    gap: 10px;

}



.header-btn {

    padding: 6px 12px;

    background: var(--secondary-color);

    color: white;

    border: none;

    border-radius: 4px;

    cursor: pointer;

    font-weight: 500;

    font-size: 0.85rem; /* <<< Temel boyuta göre biraz küçük */

    /* margin-left: 10px; */ /* user-actions gap kullandığı için bu gereksiz olabilir */

}



/* style.css içine YENİ kural olarak ekleyin */

.action-btn {

    padding: 8px 12px;

    border: none;

    border-radius: 4px;

    cursor: pointer;

    font-size: 0.9rem;

    margin: 2px; /* Butonlar arasına küçük boşluk */

    line-height: 1.4;

    text-align: center;

}

/* Renkler (varsa güncelleyin, yoksa ekleyin) */

.action-btn.primary { background-color: var(--secondary-color, #3498db); color: white; }

.action-btn.secondary { background-color: #ecf0f1; color: #34495e; border: 1px solid #dcdfe3; }

.action-btn.danger { background-color: var(--accent-color, #e74c3c); color: white; }

.action-btn.ghost { background-color: transparent; color: #555; border: 1px solid #ccc; }

.action-btn:disabled { background-color: #bdc3c7; color: #7f8c8d; cursor: not-allowed; }





.header-btn:hover {

    background: #2980b9;

}



/* Main Container */

.main-container {

    display: flex;

    flex: 1;

    width: 100%;

    /* DÜZENLEME: overflow: hidden kaldırıldı, esneklik için min-height eklendi */

    min-height: 0;

}



/* Drawing Area */

.drawing-area {

    flex: 1;

    background: white;

    position: relative;

    overflow: hidden; /* Sadece çizim alanında taşmayı engelle */

    display: flex; /* Canvas'ın %100 boyut alması için */

}



#drawingCanvas {

    display: block;

    background: #fafafa;

    cursor: crosshair;

    /* DÜZENLEME: Canvas'ın parent'ına tam uyması için eklendi */

    width: 100%;

    height: 100%;

}



/* Footer */

footer {

    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-color);

    color: white;

    padding: 0.5rem 1rem;

    /* DÜZENLEME: Footer'ın küçülmesini engelle */

    flex-shrink: 0;
    z-index: 900;

}



.footer-content {

    display: flex;

    justify-content: space-between;

    align-items: center;

    max-width: 100%;

    margin: 0 auto;

}



.status-info {

    font-size: 0.85rem;

    color: #bdc3c7;

    display: flex;

    align-items: center;

}

#status-msg { /* ID seçici daha güçlü */

    font-size: 0.85rem;

    color: #bdc3c7;

}

/* Zoom Butonları */

.zoom-buttons {

    display: grid;

    grid-template-columns: 1fr 1fr 1fr;

    gap: 0.3rem;

    margin: 0.5rem 0;

}



.zoom-buttons .action-btn {

    margin-bottom: 0;

    padding: 0.5rem;

    font-weight: bold;

}



/* =========================== */

/* Tank Seçim Modalı Stilleri (MODERN VERSİYON) */

/* =========================== */



/* Arka planı karartan katman */

.modal-overlay {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background-color: rgba(0, 0, 0, 0.6);

    backdrop-filter: blur(4px);

    display: none !important;

    justify-content: center;

    align-items: center;

    z-index: 2000;

    opacity: 0;

    transition: opacity 0.3s ease;

}



/* Modalı görünür yapan class */

.modal-overlay.visible {

    display: flex !important;

    opacity: 1;

}



/* Modal İçerik Kutusu */

.modal-content {

    background: white;

    padding: 0;

    border-radius: 14px;

    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);

    width: 90%;

    max-width: 420px;

    max-height: 90vh;

    overflow-y: auto;

    overflow-x: hidden;

    border: 1px solid rgba(0, 0, 0, 0.08);

    transform: scale(0.9);

    transition: none;

    position: relative;

}



/* Modal scrollbar styling */

.modal-content::-webkit-scrollbar {

    width: 6px;

}



.modal-content::-webkit-scrollbar-track {

    background: #f1f1f1;

    border-radius: 0 14px 14px 0;

}



.modal-content::-webkit-scrollbar-thumb {

    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    border-radius: 3px;

}



.modal-content::-webkit-scrollbar-thumb:hover {

    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);

}



.modal-overlay.visible .modal-content {

    transform: scale(1);

}



/* Modal Header */

.modal-content h3,

.modal-content .modal-header {

    margin: 0;

    padding: 16px 20px;

    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    color: white;

    font-weight: 700;

    font-size: 16px;

    border-radius: 14px 14px 0 0;

    border-bottom: none;

    display: flex;

    align-items: center;

    gap: 10px;

    cursor: grab;

    user-select: none;

    touch-action: none;

}



.modal-content h3.dragging,

.modal-content .modal-header.dragging {

    cursor: grabbing;

}



.modal-grip {

    font-size: 18px;

    opacity: 0.8;

    line-height: 1;

}



.modal-title {

    flex: 1;

}



/* Modal Body - Form Container */

.modal-content .property-group,

.modal-content .form-group {

    padding: 0 20px;

    margin: 16px 0;

}



.modal-content .property-group:first-of-type,

.modal-content .form-group:first-of-type {

    margin-top: 20px;

}



.modal-content label {

    display: block;

    margin-bottom: 8px;

    font-weight: 600;

    font-size: 13px;

    color: #374151;

}



/* Select Inputs */

.modal-content select {

    width: 100%;

    padding: 10px 12px;

    border: 1px solid #e2e8f0;

    border-radius: 10px;

    font-size: 14px;

    background: #f8fafc;

    cursor: pointer;

    transition: all 0.2s;

}



.modal-content select:hover {

    border-color: #0284c7;

    background: #fff;

}



.modal-content select:focus {

    outline: none;

    border-color: #0284c7;

    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);

}



/* Text Inputs */

.modal-content input[type="email"],

.modal-content input[type="password"],

.modal-content input[type="text"] {

    width: 100%;

    padding: 10px 12px;

    border: 1px solid #e2e8f0;

    border-radius: 10px;

    font-size: 14px;

    background: #f8fafc;

    transition: all 0.2s;

}



.modal-content input:focus {

    outline: none;

    border-color: #0284c7;

    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);

    background: #fff;

}



/* Radio Group */

.radio-group {

    display: flex;

    gap: 12px;

    flex-wrap: wrap;

}



.radio-group label {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 10px 16px;

    background: #f8fafc;

    border: 2px solid #e2e8f0;

    border-radius: 10px;

    cursor: pointer;

    transition: all 0.2s;

    font-weight: 500;

    font-size: 14px;

    margin-bottom: 0;

}



.radio-group label:hover {

    background: #e0f2fe;

    border-color: #0284c7;

}



.radio-group input[type="radio"] {

    cursor: pointer;

    width: 18px;

    height: 18px;

}



.radio-group label:has(input[type="radio"]:checked) {

    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    border-color: #0284c7;

    color: white;

}



/* Modal Butonları */

.modal-buttons {

    padding: 16px 20px 20px;

    display: flex;

    gap: 10px;

    justify-content: flex-end;

    background: #f8fafc;

    border-top: 1px solid #e5e7eb;

    margin-top: 20px;

}



.modal-buttons .action-btn {

    padding: 10px 20px;

    border: none;

    border-radius: 10px;

    font-weight: 600;

    font-size: 14px;

    cursor: pointer;

    transition: all 0.2s;

    margin: 0;

}



.modal-buttons .action-btn.primary {

    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    color: white;

}



.modal-buttons .action-btn.primary:hover {

    transform: scale(1.05);

    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);

}



.modal-buttons .action-btn.secondary {

    background: #e2e8f0;

    color: #475569;

}



.modal-buttons .action-btn.secondary:hover {

    background: #cbd5e1;

}



/* Muted Text */

.modal-content .muted {

    font-size: 12px;

    color: #6b7280;

    line-height: 1.4;

}



/* Tank Accessory Wrapper */

#reg1kWrap {

    margin-top: 12px;

    padding: 12px;

    background: #f8fafc;

    border-radius: 10px;

    border: 1px solid #e5e7eb;

}



#reg1kWrap label {

    margin-top: 0;

}



#reg1kWrap .muted {

    padding: 8px;

    background: white;

    border-radius: 6px;

    border-left: 3px solid #667eea;

}



#reg1kWrap .muted strong {

    color: #667eea;

    font-weight: 600;

}



/* Responsive */

@media (max-width: 560px) {

    .modal-content {

        width: 95%;

        max-width: none;

    }



    .radio-group {

        flex-direction: column;

    }



    .radio-group label {

        width: 100%;

    }

}



/* Object Library Panel specific styles */

#objectLibraryPanel .olib-header{

    cursor: grab;

    user-select: none;

}

#objectLibraryPanel.dragging{

    cursor: grabbing;

}

#objectLibraryPanel .footer label input {

    transform: scale(1.1);

    cursor: pointer;

}



/* Hata Mesajları */

.auth-error {

    color: var(--accent-color, #e74c3c);

    font-size: 0.85rem;

    display: flex; /* Başlangıçta gizli */

    margin-top: 10px;

    margin-bottom: 0; /* Alttaki butonlara çok yakın olmasın */

}

/* style.css */

.main-container.hidden {

  display: flex; /* Başlangıçta ana içeriği gizle */

}

#login-form-element {

    /* Bu, içindeki tüm blok öğelerin hizalanmasını sağlar */

    display: flex;

    flex-direction: column; /* Öğeleri dikey olarak sırala */

    align-items: flex-end; /* Tüm iç öğeleri sağa hizala */

}



#forgot-password-link {

    /* Sadece bağlantının kendisini sağa hizalamak istiyorsak,

       bağlantı zaten display: block olduğu için metin hizalaması işe yarar.

       Ancak, flexbox ile sağa hizalamak daha modern ve kesin sonuç verir.

       

       Eğer flexbox kullanıyorsak:

    */

    align-self: flex-end; /* Bağlantıyı flex konteyner içinde sağa hizalar */

    

    /* Eski text-align metodu: */

    /* text-align: right; */

    

    /* Gerekli diğer düzenlemeler */

    width: auto; /* Genişliğini içeriği kadar yap */

    margin-right: 0; /* Sağdan boşluk varsa temizle */

}



/* Zorunlu Değil, Ancak Gerekebilir: */

/* Eğer flexbox tüm formu etkilediyse, form gruplarını sola yaslayalım */

#login-form-element .property-group {

    width: 100%; /* Giriş alanlarının form genişliğini kaplamasını sağla */

    align-self: flex-start; /* Sola geri hizala */

}



/* =========================== */

/* SNAP (Yakala) Toggle Button */

/* =========================== */



.snap-toggle-btn {

    position: fixed;

    right: 14px;
    left: auto;

    /* Position under Object Library button; fallback keeps previous value */
    top: var(--snap-top, 180px);
    z-index: 99996;
    display: none;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    width: 140px; /* Slightly wider to fit checkmark */

    /* Ribbon Style Match */
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    cursor: pointer;
}



.snap-toggle-btn .snap-text {

    font-weight: 600;

    letter-spacing: 0.3px;

}



.snap-toggle-btn:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2), 0 2px 4px rgba(0, 0, 0, 0.05);
}



.snap-toggle-btn:active {

    transform: translateY(0);

}



/* SNAP Açık Durum */

.snap-toggle-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #059669;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.snap-toggle-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    background: rgba(0, 0, 0, 0.25);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}



.snap-toggle-btn.active .snap-icon {

    opacity: 1;

}



.snap-toggle-btn.active:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}



/* Touch mode */

body.touch-mode .snap-toggle-btn {

    padding: 12px 18px;

    font-size: 14px;

}



/* Responsive */

@media (max-width: 768px) {

    .snap-toggle-btn {

        right: 12px;
        left: auto;

        top: 125px;

        width: 110px;

        padding: 9px 14px;

        font-size: 12px;

    }

}



/* =========================== */

/* 90° Açı Kilidi Toggle Button */

/* =========================== */



.angle-lock-toggle-btn {
    position: fixed;
    right: 14px;
    left: auto;
    /* Position under Snap button; fallback keeps previous value */
    top: var(--angle-top, 184px);
    z-index: 99996;
    display: none;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    width: 140px; /* Slightly wider to fit checkmark */

    /* Ribbon Style Match */
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.angle-lock-toggle-btn:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2), 0 2px 4px rgba(0, 0, 0, 0.05);
}

.angle-lock-toggle-btn:active {
    transform: translateY(0);
}

.angle-lock-toggle-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #059669;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.angle-lock-toggle-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    background: rgba(0, 0, 0, 0.25);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.angle-lock-toggle-btn.active:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}



.angle-lock-toggle-btn .angle-lock-icon {

    font-size: 16px;

    line-height: 1;

    opacity: 0.6;

    transition: all 0.25s ease;

}



.angle-lock-toggle-btn .angle-lock-text {

    font-weight: 600;

    letter-spacing: 0.3px;

}



.angle-lock-toggle-btn:hover {

    background: #f8fafc;

    border-color: #94a3b8;

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

}



.angle-lock-toggle-btn:active {

    transform: translateY(0);

}



/* 90° Açık Durum - Yeşil tonlar (Yakala ile aynı tema) */

.angle-lock-toggle-btn.active {

    background: linear-gradient(135deg, #10b981 0%, #059669 100%);

    border-color: #059669;

    color: white;

    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);

}



.angle-lock-toggle-btn.active .angle-lock-icon {

    opacity: 1;

}



.angle-lock-toggle-btn.active:hover {

    background: linear-gradient(135deg, #059669 0%, #047857 100%);

    transform: translateY(-2px);

    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);

}



/* Touch mode */

body.touch-mode .angle-lock-toggle-btn {

    padding: 12px 18px;

    font-size: 14px;

}



/* Responsive */

@media (max-width: 768px) {

    .angle-lock-toggle-btn {

        right: 12px;
        left: auto;




/* Hide floating UI while wizard is open */
body.wizard-open #btnObjectLibrary,
body.wizard-open .snap-toggle-btn,
body.wizard-open .angle-lock-toggle-btn,
body.wizard-open #btnCloseMode { display: none !important; }

/* Touch metre keypad - Compact & Stable */
.touch-meter-keypad {
    width: 100%;
    box-sizing: border-box;
}

.touch-meter-keypad .meter-key-btn {
    padding: 14px 0;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-meter-keypad .meter-key-btn.meter-key-action {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}

/* Increment/Decrement buttons - Different color */
.touch-meter-keypad .meter-key-btn[data-key="inc"],
.touch-meter-keypad .meter-key-btn[data-key="dec"] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.touch-meter-keypad .meter-key-btn[data-key="inc"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #059669;
    color: white;
    font-weight: 700;
}

.touch-meter-keypad .meter-key-btn[data-key="dec"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
    color: white;
    font-weight: 700;
}

/* Enhanced press effect */
.touch-meter-keypad .meter-key-btn:active {
    transform: scale(0.92);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
    filter: brightness(0.9);
}

.touch-meter-keypad .meter-key-btn[data-key="inc"]:active {
    box-shadow: inset 0 2px 6px rgba(5, 150, 105, 0.5);
}

.touch-meter-keypad .meter-key-btn[data-key="dec"]:active {
    box-shadow: inset 0 2px 6px rgba(220, 38, 38, 0.5);
}


/* Show snap and angle buttons when in drawing mode */
.snap-toggle-btn.drawing-mode-visible,
.angle-lock-toggle-btn.drawing-mode-visible {
    display: flex !important;
}
