/* --- HYDRAULIC CALCULATOR STYLES --- */

/* Wrapper & Blur Lock */
.calc-wrapper {
    padding-top: 120px;
    padding-bottom: 60px;
    min-height: 90vh;
    transition: filter 0.4s ease;
}

.calc-tool-locked {
    pointer-events: none !important;
    user-select: none !important;
    filter: blur(6px) grayscale(40%);
}

/* --- TOOL TAB BUTTONS --- */
.calc-nav-scroll {
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 5px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
body.dark-mode .calc-nav-scroll { border-color: rgba(255,255,255,0.1); }
.calc-nav-scroll::-webkit-scrollbar { display: none; }

.calc-tab-btn {
    display: inline-block;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 24px;
    margin-right: 5px;
    border-radius: 12px 12px 0 0;
    transition: 0.3s;
    border-bottom: 3px solid transparent;
}
.calc-tab-btn:hover { color: var(--accent-color); background: rgba(59, 130, 246, 0.05); }
.calc-tab-btn.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
    background: linear-gradient(to top, rgba(59, 130, 246, 0.1), transparent);
}

.calc-tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}
.calc-tab-pane.active { display: block; }

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

/* --- CONTROLS BAR (Top Inputs) --- */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    padding: 20px 25px;
    background: rgba(0,0,0,0.02);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 25px;
}
body.dark-mode .controls-bar { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.05); }

.global-input-group { display: flex; flex-direction: column; gap: 6px; }
.global-input-group label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;}
.global-input-group input, .global-input-group select {
    width: 160px; height: 42px;
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px; padding: 0 12px;
    font-size: 1rem; color: var(--text-main);
    transition: 0.2s; font-weight: 600;
}
body.dark-mode .global-input-group input, body.dark-mode .global-input-group select { background-color: rgba(0,0,0,0.2); color: white; border-color: rgba(255,255,255,0.1); }
.global-input-group input:focus, .global-input-group select:focus { border-color: var(--accent-color); outline: none; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); }

/* --- PREMIUM GLASS TABLES --- */
.calc-table-container {
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow-x: auto;
    margin-bottom: 25px;
    background: var(--glass-bg);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.02), 0 10px 30px rgba(0,0,0,0.03);
    -webkit-overflow-scrolling: touch;
}
body.dark-mode .calc-table-container { box-shadow: inset 0 0 20px rgba(0,0,0,0.2), 0 10px 30px rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.1); }

.calc-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1200px; }

.calc-table th {
    background: rgba(59, 130, 246, 0.05);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    border-right: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}
body.dark-mode .calc-table th { background: rgba(255,255,255,0.03); color: #cbd5e1; border-color: rgba(255,255,255,0.1); }

.calc-table td {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    height: 42px;
    padding: 0;
    position: relative;
    vertical-align: middle;
}
body.dark-mode .calc-table td { border-color: rgba(255,255,255,0.05); }

.calc-table td.block-end-border, .calc-table th.header-bottom { border-bottom: 2px solid rgba(0,0,0,0.15) !important; }
body.dark-mode .calc-table td.block-end-border, body.dark-mode .calc-table th.header-bottom { border-bottom: 2px solid rgba(255,255,255,0.15) !important; }

.sticky-col-left, .sticky-col-left-2 {
    position: sticky; left: 0; z-index: 10;
    background-color: var(--glass-bg) !important;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 2px solid var(--accent-color) !important;
}
.sticky-col-right {
    position: sticky; right: 0; z-index: 10;
    background-color: var(--glass-bg) !important;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-left: 2px solid var(--accent-color) !important;
}

.calc-table input, .calc-table select, .calc-table .read-only, .calc-table .sticky-content {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border: none; background: transparent; text-align: center;
    font-size: 0.95rem; font-weight: 600; color: var(--text-main);
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
    white-space: pre-wrap;
}
body.dark-mode .calc-table input, body.dark-mode .calc-table select, 
body.dark-mode .calc-table .read-only, body.dark-mode .calc-table .sticky-content { color: white; }

.calc-table input:not(:read-only), .calc-table select { background-color: rgba(255,255,255,0.5); }
body.dark-mode .calc-table input:not(:read-only), body.dark-mode .calc-table select { background-color: rgba(0,0,0,0.2); }

.calc-table .read-only, .calc-table input:read-only { color: var(--text-muted); pointer-events: none; background: transparent; }

.calc-table input:focus, .calc-table select:focus {
    background-color: rgba(59, 130, 246, 0.1) !important;
    box-shadow: inset 0 0 0 2px var(--accent-color);
    outline: none; z-index: 2;
}

.calc-table input[type="number"]::-webkit-inner-spin-button, .calc-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.calc-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.calc-table select {
    appearance: none; cursor: pointer; padding-right: 14px; text-align-last: center;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 6px center; background-size: 12px;
}
body.dark-mode .calc-table select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* --- TAB 5 SPECIFIC --- */
.tab5-table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); margin-bottom: 25px; }
.tab5-table th { background: rgba(59, 130, 246, 0.05); font-weight: 700; padding: 12px; text-align: left; border-bottom: 1px solid var(--glass-border); }
.tab5-table td { border-bottom: 1px solid rgba(0,0,0,0.05); padding: 12px; vertical-align: middle; }
.tab5-table tr:last-child td { border-bottom: none; }
body.dark-mode .tab5-table td { border-bottom-color: rgba(255,255,255,0.05); }

.tab5-table .input-cell { background: rgba(255,255,255,0.4); padding: 0; position: relative; }
body.dark-mode .tab5-table .input-cell { background: rgba(0,0,0,0.2); }
.tab5-table .input-cell input { width: 100%; height: 100%; border: none; background: transparent; text-align: center; font-weight: bold; color: inherit; outline: none; padding: 12px; }
.tab5-table .input-cell input:focus { box-shadow: inset 0 0 0 2px var(--accent-color); }
.tab5-table .output-cell { background: transparent; text-align: center; font-weight: bold; color: var(--accent-color); font-size: 1.1rem; }

/* --- TOOLTIPS --- */
.custom-tooltip {
    position: fixed; background: rgba(15, 23, 42, 0.95); color: #fff; padding: 8px 12px;
    border-radius: 8px; font-size: 13px; pointer-events: none; z-index: 10000; font-weight: 600;
    transform: translate(-50%, -150%); opacity: 0; transition: opacity 0.2s; white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1);
}
.custom-tooltip.visible { opacity: 1; }

.copy-tooltip {
    position: fixed; background: var(--accent-color); color: #fff; padding: 6px 12px;
    border-radius: 6px; font-size: 12px; pointer-events: none; z-index: 10000; font-weight: 700;
    transform: translate(-50%, -10px); opacity: 0; transition: opacity 0.2s, transform 0.2s; 
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4); white-space: nowrap;
}
.copy-tooltip.visible { opacity: 1; transform: translate(-50%, -20px); }

.cell-clicked { animation: clickFlash 0.3s ease-out; }
@keyframes clickFlash {
    0% { background-color: var(--accent-color) !important; color: #fff; }
    100% { background-color: transparent; color: inherit; }
}

/* --- TAB 3 & 4 STATIC TABLE FIXES --- */
.static-data-table { table-layout: fixed; }
.static-data-table td:not(.sticky-col-left-2) { cursor: pointer; }

.static-data-table tbody tr.crosshair-hover td { background-color: rgba(59, 130, 246, 0.08) !important; }
.static-data-table tbody td.crosshair-hover-col { background-color: rgba(59, 130, 246, 0.08) !important; }
.static-data-table tbody tr.crosshair-hover td.crosshair-hover-col {
    background-color: rgba(59, 130, 246, 0.15) !important; box-shadow: inset 0 0 0 1px var(--accent-color);
}

body.dark-mode .static-data-table tbody tr.crosshair-hover td,
body.dark-mode .static-data-table tbody td.crosshair-hover-col { background-color: rgba(255, 255, 255, 0.05) !important; }
body.dark-mode .static-data-table tbody tr.crosshair-hover td.crosshair-hover-col { background-color: rgba(255, 255, 255, 0.1) !important; }

.static-data-table tbody tr td.sticky-col-left-2 { background-color: var(--glass-bg) !important; }
.static-data-table tbody tr.crosshair-hover td.sticky-col-left-2 { background-color: var(--glass-bg) !important; }

/* --- TAB 1 & 2 ROWSPAN HEIGHT FIX --- */
.calc-table tbody tr {
    height: 20px;
}

.calc-table tbody td[rowspan="2"] { height: 33.333% !important; }
.calc-table tbody td[rowspan="3"] { height: 50% !important; }
.calc-table tbody td[rowspan="6"] { height: 100% !important; }

/* --- EDITABLE & DROPDOWN CELL COLORS --- */
.calc-table input:not(:read-only),
.tab5-table .input-cell {
    background-color: rgba(34, 197, 94, 0.15) !important;
    transition: 0.2s ease;
}

body.dark-mode .calc-table input:not(:read-only),
body.dark-mode .tab5-table .input-cell {
    background-color: rgba(34, 197, 94, 0.2) !important;
}

.calc-table input:not(:read-only):focus,
.tab5-table .input-cell input:focus {
    background-color: rgba(34, 197, 94, 0.25) !important;
    box-shadow: inset 0 0 0 2px #22c55e !important;
}

.calc-table select {
    background-color: rgba(59, 130, 246, 0.15) !important;
    transition: 0.2s ease;
}

body.dark-mode .calc-table select {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

.calc-table select:focus {
    background-color: rgba(59, 130, 246, 0.25) !important;
    box-shadow: inset 0 0 0 2px var(--accent-color) !important;
}

#multValue {
    border: 2px solid var(--accent-color) !important;
    border-radius: 8px !important;
    padding: 4px 16px !important;
    background-color: var(--glass-bg) !important;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1) !important;
}

/* =====================================================================
   AUTH MODAL & WIZARD STYLES (MATCHING LOGIN PAGE)
   ===================================================================== */
#authModal .modal-content {
    background: var(--glass-bg, #ffffff) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1)) !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
}

body.dark-mode #authModal .modal-content {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6) !important;
}

.auth-tabs {
    display: flex;
    padding: 0 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.dark-mode .auth-tabs {
    border-color: rgba(255,255,255,0.08);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--accent-color, #3b82f6) !important;
    border-bottom-color: var(--accent-color, #3b82f6) !important;
}

.social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.2s;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    color: #333;
    margin-bottom: 12px;
}

body.dark-mode .social-btn {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: white;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted, #64748b);
    margin: 25px 0;
    font-size: 0.85rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

body.dark-mode .divider::before, body.dark-mode .divider::after {
    border-color: rgba(255,255,255,0.1);
}

.divider span {
    padding: 0 10px;
}

#authModal .form-floating > .form-control {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.7);
}

body.dark-mode #authModal .form-floating > .form-control {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
    color: white;
}

#authModal .form-floating > label {
    color: var(--text-muted, #64748b);
}

/* Animations */
.step-container, .pw-step {
    animation: authFadeIn 0.4s ease;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Custom Dropdown System in Modal */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.custom-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    color: var(--text-color, #1e293b);
    transition: 0.2s;
}

body.dark-mode .custom-select-display {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
    color: white;
}

.custom-select-display .display-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.custom-select-display .floating-label {
    font-size: 0.8rem;
    opacity: 0.65;
    margin-bottom: 1px;
}

.custom-select-display .selected-text {
    font-size: 1rem;
    font-weight: 500;
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass-bg, #ffffff);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
    border-radius: 12px;
    margin-top: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none;
    overflow: hidden;
}

body.dark-mode .custom-select-dropdown {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.custom-select-search {
    padding: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.custom-select-search input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.5);
    outline: none;
}

body.dark-mode .custom-select-search input {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
    color: white;
}

.custom-select-list {
    max-height: 200px;
    overflow-y: auto;
}

.select-option {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.95rem;
}

.select-option:hover {
    background: rgba(59, 130, 246, 0.1);
}

.select-option img {
    width: 24px;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Phone Input Group */
.phone-group-wrapper {
    display: flex;
    align-items: center;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.7);
    height: 58px;
    overflow: visible;
}

body.dark-mode .phone-group-wrapper {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
}

.phone-group-wrapper .custom-select-display {
    border: none;
    border-radius: 12px 0 0 12px;
    background: transparent;
    height: 100%;
    width: 110px;
    border-right: 1px solid rgba(0,0,0,0.1);
}

body.dark-mode .phone-group-wrapper .custom-select-display {
    border-color: rgba(255,255,255,0.1);
}

.phone-group-wrapper input[type="tel"] {
    border: none;
    background: transparent;
    height: 100%;
    box-shadow: none;
    border-radius: 0 12px 12px 0;
    font-weight: 500;
}

/* Tools Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.tool-check-input {
    display: none;
}

.tool-card {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 15px 10px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: 0.3s;
    background: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

body.dark-mode .tool-card {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}

.tool-card i {
    font-size: 1.5rem;
    opacity: 0.7;
    transition: 0.3s;
}

.tool-check-input:checked + .tool-card {
    background: var(--accent-color, #3b82f6);
    color: white;
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.tool-check-input:checked + .tool-card i {
    opacity: 1;
    color: white;
}

/* Wizard Progress Dots */
.wizard-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    transition: 0.3s;
}

body.dark-mode .dot {
    background: rgba(255,255,255,0.2);
}

.dot.active {
    background: var(--accent-color, #3b82f6);
    transform: scale(1.2);
}

