/* Global Variables for easy color management */
:root {
    --bg-body: #121212;
    --bg-input: #1E1E1E;
    --text-color: white;
    --border-color: #202225;
    --accent-blue: #7289da;
    --danger-red: #f04747;
    --success-green: #43b581;
    --accent-roller: #E6C300;
    --accent-calc: #FF0000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Side Navigation Drawer Logic */
.side-nav-sensor {
    position: fixed;
    left: 0;
    top: 0;
    width: 20px; /* Wider sensor area */
    height: 100vh;
    z-index: 2000;
}

/* Visual Hint Pull Tab */
.nav-pull-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 60px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 2002;
    color: var(--accent-blue);
    font-weight: bold;
}

.side-nav-drawer {
    position: fixed;
    left: 0;
    top: 0;
    width: 200px;
    height: 100vh;
    background-color: var(--bg-input);
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: 50px;
    z-index: 2001;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
}

/* Expand logic and hide pull tab on hover */
.side-nav-sensor:hover .side-nav-drawer,
.side-nav-drawer:hover {
    transform: translateX(0);
}

.side-nav-sensor:hover .nav-pull-tab {
    opacity: 0;
}

.nav-link-btn {
    display: block;
    margin: 15px;
    padding: 12px;
    background-color: var(--accent-blue);
    color: white;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    font-size: 14px;
}

.nav-link-btn:hover {
    opacity: 0.9;
}

/* Header Styles */
.app-header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.app-header h1 {
    font-size: 32px;
    margin-bottom: 5px;
}

.app-header h2 {
    font-size: 18px;
    font-weight: normal;
}

.accent-roller { color: var(--accent-roller); }
.accent-calc { color: var(--accent-calc); }

.outer-layout {
    display: flex;
    width: 1400px;
    height: 550px;
    padding: 10px;
    margin-bottom: 40px;
}

/* Global Input, Select, and Textarea Styling */
input[type="text"], 
select, 
textarea, 
.dropdown-trigger, 
.dropdown-options {
    background-color: var(--bg-input) !important;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
}

input[type="text"], select, .dropdown-trigger {
    height: 28px;
    font-size: 12px;
}

select option {
    background-color: var(--bg-input);
}

/* League Dropdown Layout */
.custom-dropdown {
    position: relative;
    width: 40px;
    user-select: none;
}

.dropdown-trigger {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.dropdown-trigger img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.dropdown-options {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px;
    gap: 5px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.dropdown-options.active {
    display: grid;
}

.league-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.league-option:hover {
    background-color: rgba(255,255,255,0.1);
}

.league-option img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Left Panel Layout */
.left-panel {
    width: 270px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.global-lane {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.power-group { width: 130px; }
.league-group { 
    width: 75px; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group label {
    font-weight: bold;
    font-size: 12px;
}

/* Integrated Inputs */
.integrated-input {
    position: relative;
    width: 100%;
}

.integrated-input input {
    width: 100%;
    text-align: center;
}

.search-box-container { width: 200px; }
.search-box-container input { text-align: left; padding-left: 10px; }

.clear-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--danger-red);
    font-size: 14px;
    cursor: pointer;
    display: none;
}

.integrated-input input:not(:placeholder-shown) + .clear-btn {
    display: block;
}

/* Loader Styles */
.loader-container {
    width: 250px;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    align-self: center;
}

.loader-line {
    width: 0%;
    height: 100%;
    background-color: var(--success-green);
    border-radius: 4px;
    transition: width 5s linear;
}

.loader-label {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    font-size: 7px; font-weight: bold; pointer-events: none;
}

/* Paste Widget */
.paste-widget {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.paste-title {
    font-weight: bold;
    color: var(--accent-blue);
    font-size: 13px;
    text-align: center;
    margin-bottom: 2px;
}

textarea {
    flex-grow: 1;
    padding: 5px;
    resize: none;
}

.paste-btns-centered {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    justify-content: center;
}

/* General Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-weight: bold;
    color: white;
}

.btn-primary { background-color: var(--accent-blue); }
.btn-primary:hover { opacity: 0.9; }
.btn-danger { background-color: var(--danger-red); }

/* Right Panel Content */
.right-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.divider {
    width: 1px;
    background-color: var(--border-color);
    margin: 0 10px;
}

.top-lane {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.currency-select { width: 70px; }

.paste-instruction {
    color: white;
    font-style: italic;
    font-size: 11px;
    margin-left: 5px;
    white-space: nowrap;
}

/* Table Alignment */
.scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.table-header {
    display: flex;
    gap: 10px;
    padding: 5px;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 12px;
}

.header-item {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.net-power-header { width: 125px; }

.crypto-row {
    display: flex;
    gap: 10px;
    padding: 5px;
    align-items: center;
}

.crypto-row > div {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.crypto-icon { width: 24px; height: 24px; object-fit: contain; }
.row-perc { width: 130px; text-align: center; }
.row-net-p { width: 70px; }
.row-net-u { width: 55px; }
.row-rew { width: 80px; }
.row-dur { width: 85px; }

/* Custom Scrollbar */
.scroll-area::-webkit-scrollbar { width: 10px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 5px; }

/* Footer Styling */
.app-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    pointer-events: none;
    font-style: italic;
    color: #888888;
    font-size: 11px;
    padding: 10px 0;
}

.footer-credit {
    text-align: center;
}