/**
 * itiraz-core: Randomizer & Multi-Flow Styles
 */

:root {
    --it-bg: #0A0A0C;
    --it-input: #1e293b;
    --it-blue: #0A84FF;
    --it-blue-glow: rgba(10, 132, 255, 0.4);
    --it-border: rgba(255, 255, 255, 0.1);
    --it-text: #F5F5F7;
    --it-muted: #86868B;
    --it-glass: rgba(28, 28, 30, 0.75);
    --it-green: #32D74B;
    --it-red: #FF453A;
    --it-orange: #FF9F0A;
    --it-gold: #FFD700;
    --it-gold-glow: rgba(255, 215, 0, 0.3);
    --it-bg-card: rgba(28, 28, 30, 0.6);
}

.itiraz-hud-wrapper {
    all: unset;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: var(--it-bg);
    color: var(--it-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    min-height: 98vh;
    border-radius: 24px;
    box-sizing: border-box;
}

.glass-effect {
    background: var(--it-glass);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--it-border);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

/* --- Top Panel --- */
.itiraz-top-panel {
    padding: 16px 20px;
}

.itiraz-input-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.itiraz-input-group input {
    background: var(--it-input);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.itiraz-input-group input::placeholder {
    color: var(--it-muted);
    opacity: 0.6;
}

.itiraz-input-group input:focus {
    outline: none;
    border-color: var(--it-blue);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 0 4px var(--it-blue-glow);
    transform: translateY(-1px);
}

/* --- Select Dropdowns --- */
.it-flow-select {
    background: var(--it-input);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.3s;
}

.it-flow-select:focus {
    outline: none;
    border-color: var(--it-blue);
    box-shadow: 0 0 0 4px var(--it-blue-glow);
}

/* --- Random Button --- */
.btn-random-action {
    margin-top: 20px;
    padding: 14px;
    background: linear-gradient(135deg, #0A84FF, #0056b3);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}

.btn-random-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 132, 255, 0.5);
    filter: brightness(1.2);
}

/* --- Cockpit Grid --- */
.cockpit-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 16px;
    flex: 1;
}

/* --- Sidebar --- */
.it-sidebar-flow { padding: 20px; display: flex; flex-direction: column; }
.flow-step { margin-bottom: 20px; transition: opacity 0.3s; }
.step-label { font-size: 11px; font-weight: 700; color: var(--it-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--it-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Teleprompter --- */
.it-center-teleprompter {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.teleprompter-content {
    padding: 60px 40px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#script-title { font-size: 28px; font-weight: 800; color: var(--it-blue); margin-bottom: 20px; }
.dynamic-script-area { font-size: 22px; line-height: 1.6; }
.dynamic-script-area strong { color: var(--it-blue); }

/* --- Feature Pills --- */
.itiraz-feature-pills-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 40px;
    border-top: 1px solid var(--it-border);
}

.feature-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--it-border);
    color: var(--it-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-pill:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.feature-pill.active { border-color: var(--it-blue); color: var(--it-blue); }

/* --- Navigation Bar --- */
.itiraz-nav-bar-cockpit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px 40px;
    border-top: 1px solid var(--it-border);
}

.btn-nav {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-prev {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--it-border);
    color: var(--it-muted);
}

.btn-prev:hover { background: rgba(255, 255, 255, 0.1); color: white; }

.btn-next {
    background: var(--it-blue);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}

.btn-next:hover { transform: translateY(-2px); filter: brightness(1.15); }

/* --- Result Bar (CRM Actions) --- */
.itiraz-result-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 40px 28px;
}

.btn-res {
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-res:hover { transform: translateY(-2px); filter: brightness(1.15); }
.btn-res-success { background: var(--it-green); }
.btn-res-danger { background: var(--it-red); }
.btn-res-warning { background: var(--it-orange); color: black; }

/* --- Objections --- */
.it-sidebar-objections { padding: 20px; max-height: 700px; overflow-y: auto; }
.objection-pill {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--it-border);
    border-radius: 10px;
    margin-bottom: 8px;
    color: var(--it-muted);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.objection-pill:hover { background: rgba(255, 255, 255, 0.08); color: white; }

/* Ledger & Gold Board (Apple Premium) */

.itiraz-gold-board, .itiraz-ledger-panel { 
    padding: 30px; 
    margin-top: 20px; 
    border-radius: 24px;
}

.gold-cards-container { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
}

.gold-path-card {
    background: var(--it-bg-card);
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid var(--it-border);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gold-path-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--it-gold);
    box-shadow: 0 10px 30px var(--it-gold-glow);
}

.card-win-rate {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--it-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 15px var(--it-gold-glow);
}

.card-tries {
    font-size: 11px;
    color: var(--it-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.card-summary {
    font-size: 13px;
    line-height: 1.5;
    color: #F5F5F7;
    margin-bottom: 20px;
}

/* Ledger Table */
#itiraz-live-ledger {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

#itiraz-live-ledger th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--it-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--it-border);
}

#itiraz-live-ledger tr td {
    padding: 16px;
    font-size: 14px;
    color: #F5F5F7;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

#itiraz-live-ledger tr td:first-child { border-radius: 12px 0 0 12px; }
#itiraz-live-ledger tr td:last-child { border-radius: 0 12px 12px 0; }

#itiraz-live-ledger tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

/* Status Badges */
.badge-result {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.result-randevu-alindi { background: rgba(50, 215, 75, 0.15); color: var(--it-green); border: 1px solid rgba(50, 215, 75, 0.2); }
.result-elendi { background: rgba(255, 69, 58, 0.15); color: var(--it-red); border: 1px solid rgba(255, 69, 58, 0.2); }
.result-sonra-ara { background: rgba(255, 159, 10, 0.15); color: var(--it-orange); border: 1px solid rgba(255, 159, 10, 0.2); }

@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInRow { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.animate { animation: slideIn 0.4s ease-out; }
.new-row { animation: fadeInRow 0.5s ease-out forwards; }

/* --- Live Editor Modal --- */
.it-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.it-modal-content {
    width: 900px; /* Slightly wider for 4 tabs */
    max-height: 85vh;
    padding: 30px;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(40px) saturate(200%);
    display: flex;
    flex-direction: column;
}

.it-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.it-modal-header h2 { font-size: 20px; font-weight: 800; margin: 0; }
.btn-close { background: none; border: none; color: white; font-size: 28px; cursor: pointer; }

.it-modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--it-border);
    padding-bottom: 10px;
}

.it-tab-btn {
    background: none; border: none; color: var(--it-muted);
    padding: 8px 16px; font-weight: 700; cursor: pointer;
    transition: all 0.3s;
}

.it-tab-btn.active { color: var(--it-blue); border-bottom: 2px solid var(--it-blue); }

.it-editor-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.it-editor-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--it-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.it-editor-item label { display: block; font-size: 10px; color: var(--it-muted); text-transform: uppercase; margin-bottom: 6px; }
.it-editor-item input, .it-editor-item textarea {
    width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--it-border);
    border-radius: 8px; color: white; padding: 10px; font-size: 13px;
    margin-bottom: 10px; transition: 0.3s;
}

.it-editor-item textarea { height: 80px; resize: none; }
.it-editor-item input:focus, .it-editor-item textarea:focus { outline: none; border-color: var(--it-blue); box-shadow: 0 0 0 3px var(--it-blue-glow); }

.btn-update-script {
    background: var(--it-blue); border: none; border-radius: 8px; color: white;
    padding: 8px 16px; font-weight: 700; cursor: pointer; transition: 0.3s;
}

.btn-update-script:hover { transform: translateY(-1px); filter: brightness(1.2); }

/* --- Add New Button Styles --- */
.it-editor-add-new {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--it-border);
    text-align: center;
}

.btn-add-new-form {
    background: rgba(50, 215, 75, 0.1);
    border: 1px dashed var(--it-green);
    color: var(--it-green);
    padding: 14px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-new-form:hover {
    background: rgba(50, 215, 75, 0.2);
    box-shadow: 0 0 15px rgba(50, 215, 75, 0.3);
    transform: scale(1.02);
}

.btn-save-new-script {
    background: var(--it-green);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.it-new-item {
    border: 2px solid var(--it-green) !important;
    background: rgba(50, 215, 75, 0.05) !important;
}

.it-modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--it-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-danger { background: rgba(255, 69, 58, 0.15); border: 1px solid var(--it-red); color: var(--it-red); padding: 10px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.footer-hint { font-size: 12px; color: var(--it-muted); }

#btn-open-editor {
    background: none; border: none; cursor: pointer; font-size: 14px;
    margin-left: 8px; opacity: 0.5; transition: 0.3s;
}
#btn-open-editor:hover { opacity: 1; transform: rotate(45deg); }
.new-row { animation: fadeInRow 0.5s ease-out forwards; }

/* Shimmer Loading */
.shimmer-placeholder {
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(to right, #1c1c1e 8%, #2c2c2e 18%, #1c1c1e 33%);
    background-size: 800px 104px;
    animation: shimmer 2s infinite linear;
}
@keyframes shimmer { 0% { background-position: -468px 0; } 100% { background-position: 468px 0; } }

/* --- Toast Notifications --- */
.it-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    z-index: 99999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    animation: slideIn 0.3s ease-out;
}

.it-toast-success { background: rgba(50, 215, 75, 0.9); }
.it-toast-error { background: rgba(255, 69, 58, 0.9); }
