/**
 * Satış Bedeli Hesaplama - Public Isolated CSS
 * Everything is strictly scoped to #sbh-calculator to prevent conflicts with themes and other plugins.
 */

#sbh-calculator {
    box-sizing: border-box;
    max-width: 650px;
    margin: 20px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3e50;
    line-height: 1.5;
}

#sbh-calculator *, 
#sbh-calculator *::before, 
#sbh-calculator *::after {
    box-sizing: border-box;
}

/* Header & Tab Menu */
#sbh-calculator .sbh-header {
    text-align: center;
    margin-bottom: 20px;
}

#sbh-calculator .sbh-header h3 {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a252f;
}

#sbh-calculator .sbh-tab-menu {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 10px;
    margin-bottom: 24px;
}

#sbh-calculator .sbh-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#sbh-calculator .sbh-tab-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

#sbh-calculator .sbh-tab-btn.sbh-active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Tab Content & Forms */
#sbh-calculator .sbh-tab-content {
    display: none;
    animation: sbhFadeIn 0.3s ease-in-out;
}

#sbh-calculator .sbh-tab-content.sbh-active {
    display: block;
}

@keyframes sbhFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

#sbh-calculator .sbh-form-group {
    margin-bottom: 16px;
}

#sbh-calculator .sbh-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

#sbh-calculator .sbh-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

#sbh-calculator .sbh-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

#sbh-calculator .sbh-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#sbh-calculator .sbh-input[readonly] {
    background-color: #f8fafc;
    color: #64748b;
    cursor: default;
}

#sbh-calculator .sbh-input.sbh-kalan {
    font-size: 1.25rem;
    font-weight: 700;
    color: #166534;
    background-color: #f0fdf4;
    border-color: #86efac;
    text-align: right;
}

#sbh-calculator .sbh-input.sbh-kalan.sbh-negative {
    color: #991b1b;
    background-color: #fef2f2;
    border-color: #fca5a5;
}

/* Dynamic Expenses List */
#sbh-calculator .sbh-masraflar-listesi {
    margin-bottom: 10px;
}

#sbh-calculator .sbh-ek-masraf-item {
    margin-bottom: 12px;
}

/* Helper Buttons & Links */
#sbh-calculator .sbh-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    margin-top: -4px;
    margin-bottom: 12px;
}

#sbh-calculator .sbh-link-btn:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Buttons */
#sbh-calculator .sbh-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

#sbh-calculator .sbh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

#sbh-calculator .sbh-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

#sbh-calculator .sbh-btn-primary:hover {
    background: #1d4ed8;
}

#sbh-calculator .sbh-btn-secondary {
    background: #64748b;
    color: #ffffff;
}

#sbh-calculator .sbh-btn-secondary:hover {
    background: #475569;
}

#sbh-calculator .sbh-btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #334155;
}

#sbh-calculator .sbh-btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

#sbh-calculator .sbh-btn-danger {
    background: #ef4444;
    color: #ffffff;
    padding: 6px 12px;
}

#sbh-calculator .sbh-btn-danger:hover {
    background: #dc2626;
}

/* Modal Popup */
#sbh-masraf-modal {
    box-sizing: border-box;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#sbh-masraf-modal .sbh-modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#sbh-masraf-modal h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: #0f172a;
}

#sbh-masraf-modal .sbh-form-group {
    margin-bottom: 14px;
}

#sbh-masraf-modal label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

#sbh-masraf-modal input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
}

#sbh-masraf-modal .sbh-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* Saved Calculations Section */
#sbh-calculator .sbh-saved-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed #e2e8f0;
}

#sbh-calculator .sbh-saved-section h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

#sbh-calculator .sbh-saved-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sbh-calculator .sbh-saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
}

#sbh-calculator .sbh-saved-info {
    display: flex;
    flex-direction: column;
}

#sbh-calculator .sbh-saved-info strong {
    font-size: 0.9rem;
    color: #1e293b;
}

#sbh-calculator .sbh-saved-date {
    font-size: 0.75rem;
    color: #64748b;
}

#sbh-calculator .sbh-saved-actions {
    display: flex;
    gap: 6px;
}

#sbh-calculator .sbh-empty-msg {
    font-size: 0.85rem;
    color: #94a3b8;
    font-style: italic;
}