/* -------------------------------------------------------------------------- */
/* MAIN STYLESHEET - TROUWRINGEN CONFIGURATOR                               */
/* -------------------------------------------------------------------------- */

:root {
    /* Renk Paleti */
    --primary-color: #2c3e50;       /* Koyu Lacivert (Metinler, Başlıklar) */
    --primary-accent: #3498db;      /* Vurgu Mavisi (Linkler, Aktif Durumlar) */
    --secondary-accent: #e74c3c;    /* Vurgu Kırmızısı (Hata, Silme) */
    --gold: #D8BC7E;                /* Altın Rengi (Lüks Vurgular) */
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-body: #fdfdfd;
    --bg-panel: #ffffff;
    --border-color: #e5e7eb;
    
    /* Gölgeler ve Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-md: 6px;
    --radius-lg: 12px;
    
    /* Fontlar */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', serif;
}

/* -------------------------------------------------------------------------- */
/* 1. GLOBAL RESET & TYPOGRAPHY                                             */
/* -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-dark);
    overflow: hidden; /* Tam ekran uygulama */
    height: 100vh;
    width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--primary-color);
    margin-top: 0;
}

a { text-decoration: none; color: var(--primary-accent); transition: 0.2s; }
a:hover { color: var(--primary-color); }

ul { list-style: none; }

/* -------------------------------------------------------------------------- */
/* 2. LAYOUT (APP WRAPPER)                                                  */
/* -------------------------------------------------------------------------- */
.app-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px); /* Header yüksekliğini çıkar */
    display: flex;
    flex-direction: column;
}

#canvas-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; /* En arkada */
    background: radial-gradient(circle at center, #ffffff 0%, #f3f4f6 100%);
}

#ui-layer {
    position: relative;
    z-index: 10; /* Canvas'ın önünde */
    height: 100%;
    pointer-events: none; /* Tıklamalar canvas'a geçsin */
    display: flex;
    flex-direction: column;
}

/* UI içindeki tüm etkileşimli elemanlar tıklanabilir olmalı */
#ui-layer > * {
    pointer-events: auto;
}

/* -------------------------------------------------------------------------- */
/* 3. ÜST BAR & NAVİGASYON                                                  */
/* -------------------------------------------------------------------------- */
.top-bar-controls {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    align-items: center;
}

/* Step Navigation (1. Profiel | 2. Maten...) */
.step-navigation-wrapper {
    background-color: #f0f4f8;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 0; /* Altındaki panel ile birleşsin */
}

.step-nav-bar {
    display: flex;
    justify-content: center;
    gap: 5px;
    overflow-x: auto;
    padding: 0 10px;
}

.nav-step-btn {
    background: #e9ecef;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 200px;
    text-align: center;
}

.nav-step-btn:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.nav-step-btn:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }

.nav-step-btn:hover { background-color: #dfe4ea; color: #000; }

.nav-step-btn.active {
    background-color: #1e4c82; /* Koyu Mavi */
    color: #fff;
}

/* -------------------------------------------------------------------------- */
/* 4. SOL PANEL (KONFİGÜRASYON)                                             */
/* -------------------------------------------------------------------------- */
.config-main-content {
    display: flex;
    flex: 1;
    pointer-events: none;
    position: relative;
}

.config-panel-left {
    width: 450px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    
    /* Konumlandırma: Sağ tarafa yaslı (Ekran görüntüsüne göre) */
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--border-color);
    border-right: none;
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
}

/* Ring Seçici (Hap Şeklinde) */
.ring-selector-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ring-tabs-pill { display: flex; gap: 5px; }

.ring-pill {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.2s;
}

.ring-pill:hover { background: rgba(0,0,0,0.05); }

.ring-pill.active {
    color: var(--primary-color);
    font-weight: 800;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ring-icon { font-size: 16px; font-weight: bold; display: block; margin-bottom: 2px; }

/* -------------------------------------------------------------------------- */
/* 5. TAB İÇERİKLERİ (PROFİL, MATEN, METAL...)                              */
/* -------------------------------------------------------------------------- */

/* Genel Tab Başlıkları */
.step-header { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.step-title { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.step-description { color: var(--text-muted); font-size: 13px; }

/* Profil Grid (Tab 1) */
.profile-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.profile-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.profile-card:hover { border-color: #b0b0b0; transform: translateY(-2px); }
.profile-card.active { border: 2px solid var(--primary-color); background-color: #f8f9fa; }

.profile-label { font-size: 11px; font-weight: 600; color: #555; }
.profile-image-wrapper img { max-height: 40px; max-width: 100%; object-fit: contain; }

/* Maten (Tab 2) */
.dimensions-container { display: flex; gap: 20px; }
.ring-column { flex: 1; background: #fff; border-radius: 8px; padding: 5px; }
.ring-col-title { font-weight: 700; margin-bottom: 15px; font-size: 14px; color: var(--primary-accent); }

.input-label {
    font-size: 12px; font-weight: 600; color: #333; margin-bottom: 5px;
    display: flex; align-items: center; gap: 8px;
}
.custom-select { font-size: 13px; padding: 8px 12px; border-color: #e0e0e0; border-radius: 4px; }
.custom-select:focus { border-color: var(--primary-color); box-shadow: none; }

/* Metal (Tab 3) */
.partition-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.partition-card {
    border: 1px solid #e0e0e0; border-radius: 4px; padding: 10px 5px;
    text-align: center; cursor: pointer; position: relative; background: #fff;
}
.partition-card.active { border-color: var(--primary-color); background-color: #f8f9fa; }
.p-icon { width: 40px; height: 25px; margin: 0 auto; border: 1px solid #ccc; border-radius: 4px; }
.p-icon.single { background: #fff; }
.p-icon.two-tone { background: linear-gradient(90deg, #999 50%, #fff 50%); }
.p-icon.tri-tone { background: linear-gradient(90deg, #999 33%, #fff 33%, #fff 66%, #555 66%); }

/* Grooves (Tab 4) */
.sub-tabs-container { display: flex; border-bottom: 1px solid #e0e0e0; margin-bottom: 20px; }
.sub-tab-btn {
    flex: 1; background: none; border: none; padding: 12px;
    font-size: 14px; font-weight: 600; color: #555; cursor: pointer;
    border-bottom: 2px solid transparent;
}
.sub-tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.groove-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.groove-card {
    border: 1px solid #e0e0e0; border-radius: 4px; padding: 10px;
    text-align: center; cursor: pointer; height: 90px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.groove-card.active { border: 1px solid var(--primary-color); box-shadow: 0 0 0 1px var(--primary-color); }

/* Stones (Tab 5) */
.stone-list-header { display: flex; gap: 10px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.stone-item { padding: 5px 15px; background: #f0f0f0; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
.stone-item.active { background: #eef2ff; color: var(--primary-color); border: 1px solid var(--primary-color); }

.setting-preview-box { border: 1px solid #e0e0e0; border-radius: 4px; padding: 15px; background: #fff; }
.cut-options { display: flex; gap: 10px; }
.cut-card {
    border: 1px solid #e0e0e0; padding: 8px; border-radius: 4px; cursor: pointer;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.cut-card.active { border-color: var(--primary-color); background-color: #f8f9fa; }

/* Engraving (Tab 6) */
.custom-input { border: 1px solid #e0e0e0; padding: 10px; font-size: 14px; border-radius: 4px; }
.symbol-bar { display: flex; gap: 10px; }
.symbol-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 18px; border: 1px solid #e0e0e0; color: #555; background: #fff; }
.symbol-btn:hover { background-color: #f8f9fa; border-color: var(--primary-color); }

.font-grid { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.font-card { border: 1px solid #e0e0e0; padding: 10px 15px; border-radius: 4px; cursor: pointer; white-space: nowrap; background: #fff; }
.font-card.active { border-color: var(--primary-color); background-color: #f0f4f8; font-weight: bold; }

/* -------------------------------------------------------------------------- */
/* 6. FİYAT PANELİ (SOL ALT)                                                */
/* -------------------------------------------------------------------------- */
.price-panel-wrapper {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 380px;
    z-index: 20;
    pointer-events: auto;
}

.action-buttons-row { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.btn-action {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 20px;
    padding: 6px 12px; font-size: 11px; color: #555; cursor: pointer;
    display: flex; align-items: center; gap: 5px; transition: 0.2s;
}
.btn-action:hover { background: #f8f9fa; border-color: #ccc; color: #333; }

.price-summary-box {
    background: #f4f4f4; border-radius: 12px; padding: 15px 20px;
    position: relative; display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.price-row {
    display: flex; justify-content: space-between; font-size: 13px;
    color: #555; margin-bottom: 4px; width: 60%;
}
.price-row.total { border-top: 1px solid #ddd; color: #000; font-size: 15px; margin-top: 5px; padding-top: 5px; }

.price-actions-right {
    position: absolute; top: 15px; right: 20px;
    display: flex; flex-direction: column; align-items: flex-end;
}

.btn-je-ringen {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 20px;
    padding: 6px 15px; font-size: 12px; font-weight: 600; color: #333;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* -------------------------------------------------------------------------- */
/* 7. ZOOM KONTROLLERİ (SAĞ ÜST)                                            */
/* -------------------------------------------------------------------------- */
.zoom-controls {
    position: absolute;
    top: 20px;
    left: 20px; /* Sağ panelin içinde sol üst */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.btn-zoom {
    width: 40px; height: 40px; background: #fff; border: 1px solid #eee;
    border-radius: 50%; color: #555; font-size: 18px; cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center;
}
.btn-zoom:hover { color: var(--primary-color); }

/* -------------------------------------------------------------------------- */
/* 8. LOADER                                                                */
/* -------------------------------------------------------------------------- */
.loader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.spinner {
    width: 50px; height: 50px; border: 4px solid #f3f3f3;
    border-top: 4px solid var(--gold); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------- */
/* 9. MOBİL UYUMLULUK                                                       */
/* -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .config-panel-left {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid #eee;
        z-index: 30;
    }
    
    .price-panel-wrapper {
        width: 100%;
        left: 0;
        bottom: 50%; /* Config panelin üstüne */
        padding: 10px;
        background: transparent;
        box-shadow: none;
    }
    
    .price-summary-box {
        padding: 10px;
    }
    
    .action-buttons-row {
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .step-nav-bar {
        justify-content: flex-start;
    }
}