:root {
    --primary-glow: rgba(0, 204, 255, 0.4);
    --card-bg: #1a2a3a;
    --card-hover-bg: #1e3246;
    --accent-color: #00ccff;
    --bg-dark: #0d1a26;
    --text-main: #b3cde0;
    --text-muted: #7fa4c0;
    --success-neon: #33ff99;
    --danger-neon: #ff6666;
    --glass-border: rgba(0, 204, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Jost', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background: radial-gradient(circle at 50% -20%, #172a3c, #0d1a26);
    min-height: 100vh;
    padding-bottom: 60px;
}

body, input, select, textarea, button, h1, h2, h3, h4, h5, h6, th, td, label, p, span, li, a, b, strong {
    font-weight: 300 !important;
}

.top-nav {
    padding: 20px 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: rgba(13, 26, 38, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    gap: 12px;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.02);
}

.nav-logo {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
    text-transform: uppercase;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00ccff 0%, #33eaff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(0, 204, 255, 0.2);
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
}

.subheader {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Glassmorphic Form Card */
.form-card {
    background: rgba(26, 42, 58, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 204, 255, 0.05);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 25px;
}

.col-textarea {
    grid-column: span 5;
}

.col-dates {
    grid-column: span 3;
}

.col-options {
    grid-column: span 4;
}

/* Input Fields */
label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    background: rgba(13, 26, 38, 0.7);
    border: 1.5px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(0, 204, 255, 0.3);
    background: rgba(13, 26, 38, 0.9);
}

textarea.form-control {
    resize: none;
    font-family: 'Share Tech Mono', monospace;
}

/* Filter Checkboxes Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.checkbox-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.checkbox-label-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label-container input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--accent-color);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label-container input[type="checkbox"]:checked + .checkbox-custom {
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}

.checkbox-label-container input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 0.95rem;
    color: var(--text-main);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--accent-color);
    background: rgba(0, 204, 255, 0.1);
}

.filter-btn.active {
    color: var(--success-neon);
    background: rgba(51, 255, 153, 0.1);
}

.filter-val-input {
    width: 65px;
    padding: 4px 6px;
    background: rgba(13, 26, 38, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Share Tech Mono', monospace;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.filter-val-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 6px rgba(0, 204, 255, 0.2);
}

.d-none {
    display: none !important;
}

/* Control Buttons & Progress */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 20px;
}

.btn-group {
    display: flex;
    gap: 15px;
}

.btn {
    background: transparent;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 300;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.1);
}

.btn-danger-warn {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3) !important;
}

.btn-danger-warn:hover {
    background: linear-gradient(135deg, #ff6666 0%, #ff4444 100%) !important;
    box-shadow: 0 6px 22px rgba(255, 68, 68, 0.5) !important;
}

.warned-msg {
    display: none;
    text-align: center;
    color: var(--danger-neon);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(255, 102, 102, 0.4);
    animation: pulseGlowDanger 1s infinite alternate;
}

@keyframes pulseGlowDanger {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.btn-group:has(#LoadButton.btn-danger-warn:hover) ~ #warnedMessage {
    display: block;
}

.btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.4);
    transform: translateY(-3px);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #00ccff 0%, #0099ff 100%);
    color: #000;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 204, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #33eaff 0%, #00ccff 100%);
    box-shadow: 0 6px 22px rgba(0, 204, 255, 0.5);
}

.btn-secondary {
    border-color: #00e5ff;
    color: #00e5ff;
}

.btn-secondary:hover {
    background: #00e5ff;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.btn-outline {
    border-color: var(--text-muted);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--text-muted);
    color: #000;
    border-color: var(--text-muted);
    box-shadow: 0 0 15px rgba(127, 164, 192, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    border-color: var(--text-muted) !important;
}

/* Spinner and Loaders */
.spinner-border {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Progress Section */
.progress-container {
    flex: 1;
    min-width: 250px;
    background: rgba(13, 26, 38, 0.5);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-family: 'Share Tech Mono', monospace;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ccff, #33ff99);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 204, 255, 0.5);
}

/* Alert Boxes */
.alert {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-size: 0.95rem;
    animation: fadeIn 0.4s ease;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.05);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffe082;
}

.alert-danger {
    background: rgba(255, 70, 70, 0.05);
    border-color: rgba(255, 70, 70, 0.3);
    color: #ffab91;
}

.alert-info {
    background: rgba(0, 204, 255, 0.05);
    border-color: rgba(0, 204, 255, 0.3);
    color: #b3e5fc;
}

.alert-secondary {
    background: rgba(127, 164, 192, 0.05);
    border-color: rgba(127, 164, 192, 0.2);
    color: var(--text-main);
}

.alert-close {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Info Badges */
.loadCandlesExpl {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent-color);
    background: rgba(0, 204, 255, 0.02);
    padding: 10px 15px;
    border-radius: 4px;
    line-height: 1.5;
}

/* Results & Table Section */
.results-card {
    background: rgba(26, 42, 58, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-title {
    font-size: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-color);
    text-transform: uppercase;
}

.table-container {
    overflow-x: auto;
    background: rgba(13, 26, 38, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    max-height: 600px;
    overflow-y: auto;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background: #09131d;
    color: var(--accent-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--glass-border);
}

td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 204, 255, 0.08);
    color: var(--text-main);
    vertical-align: middle;
}

tr:nth-child(even) {
    background: rgba(0, 204, 255, 0.01);
}

tr:hover td {
    background: rgba(0, 204, 255, 0.04);
}

/* Percentage Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.bg-success {
    background: rgba(51, 255, 153, 0.15) !important;
    color: var(--success-neon) !important;
    border: 1.5px solid rgba(51, 255, 153, 0.3);
}

.bg-danger {
    background: rgba(255, 102, 102, 0.15) !important;
    color: var(--danger-neon) !important;
    border: 1.5px solid rgba(255, 102, 102, 0.3);
}

.bg-light {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-main) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.bg-bigsuccess {
    background: linear-gradient(135deg, rgba(51, 255, 153, 0.3), rgba(0, 204, 255, 0.3)) !important;
    color: #fff !important;
    border: 1.5px solid var(--success-neon);
    animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 5px rgba(51, 255, 153, 0.4); }
    to { box-shadow: 0 0 15px rgba(51, 255, 153, 0.8); }
}

.bi-rocket-takeoff {
    display: inline-block;
    transform: rotate(45deg);
}

/* Peak marker highlights */
.table-success {
    background-color: rgba(51, 255, 153, 0.08) !important;
    box-shadow: inset 0 0 8px rgba(51, 255, 153, 0.15);
}

.table-danger {
    background-color: rgba(255, 102, 102, 0.08) !important;
    box-shadow: inset 0 0 8px rgba(255, 102, 102, 0.15);
}

/* Copied confirmation tag */
#copied {
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--success-neon);
    background: rgba(51, 255, 153, 0.1);
    border: 1px solid var(--success-neon);
    border-radius: 8px;
    padding: 6px 12px;
}

/* Explanations Modal & Sections */
.explanations-row {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 25px;
}

/* Custom Modal style */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 26, 38, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-dialog {
    background: #152230;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 204, 255, 0.15);
    transform: translateY(-50px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

.modal-content {
    padding: 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-color);
    text-transform: uppercase;
}

.modal-header .close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-header .close:hover {
    color: #fff;
}

.modal-body {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.7;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-body b, .modal-body strong {
    color: var(--accent-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbars styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(13, 26, 38, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 204, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: #33eaff;
}

/* Responsive queries */
@media (max-width: 992px) {
    .form-grid {
        gap: 20px;
    }
    .col-textarea {
        grid-column: span 12;
    }
    .col-dates {
        grid-column: span 6;
    }
    .col-options {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    .col-dates {
        grid-column: span 12;
    }
    .col-options {
        grid-column: span 12;
    }
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-group {
        flex-direction: column;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .explanations-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Custom Stylish Dark Neon Flatpickr Calendar */
.flatpickr-calendar {
    background: rgba(21, 34, 48, 0.95) !important;
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent-color) !important;
    box-shadow: 0 10px 30px rgba(0, 204, 255, 0.25), 0 0 15px rgba(0, 204, 255, 0.1) !important;
    border-radius: 16px !important;
    color: var(--text-main) !important;
    font-family: 'Jost', sans-serif !important;
}

.flatpickr-calendar::before, .flatpickr-calendar::after {
    border-bottom-color: var(--accent-color) !important;
}

.flatpickr-calendar.arrowTop::before {
    border-bottom-color: var(--accent-color) !important;
}
.flatpickr-calendar.arrowTop::after {
    border-bottom-color: rgba(21, 34, 48, 0.95) !important;
}

.flatpickr-months {
    background: #09131d !important;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #09131d !important;
    color: var(--accent-color) !important;
    font-weight: 600 !important;
    font-family: 'Share Tech Mono', monospace;
}

.flatpickr-current-month input.cur-year {
    color: var(--accent-color) !important;
    font-weight: 600 !important;
    font-family: 'Share Tech Mono', monospace;
}

.flatpickr-monthDropdown-month {
    background: #0d1a26 !important;
    color: #fff !important;
}

.flatpickr-calendar .numInputWrapper span.arr {
    border: none !important;
}
.flatpickr-calendar .numInputWrapper span.arr.up::after {
    border-bottom-color: var(--accent-color) !important;
}
.flatpickr-calendar .numInputWrapper span.arr.down::after {
    border-top-color: var(--accent-color) !important;
}

.flatpickr-calendar .flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

.flatpickr-day {
    color: var(--text-main) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.flatpickr-day:hover, .flatpickr-day:focus {
    background: rgba(0, 204, 255, 0.15) !important;
    color: #fff !important;
    border-color: var(--accent-color) !important;
}

.flatpickr-day.today {
    border-color: var(--success-neon) !important;
    color: var(--success-neon) !important;
}

.flatpickr-day.today:hover {
    background: rgba(51, 255, 153, 0.15) !important;
    color: #fff !important;
}

.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: linear-gradient(135deg, #00ccff 0%, #0099ff 100%) !important;
    color: #000 !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.4) !important;
    font-weight: 600 !important;
}

.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
    color: rgba(255, 255, 255, 0.1) !important;
}

.flatpickr-time {
    border-top: 1px solid var(--glass-border) !important;
    background: #09131d !important;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    padding: 10px 0 !important;
}

.flatpickr-time input {
    color: var(--accent-color) !important;
    font-weight: 600 !important;
    font-family: 'Share Tech Mono', monospace !important;
}

.flatpickr-time .flatpickr-am-pm {
    color: var(--text-main) !important;
}

.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus, .flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(0, 204, 255, 0.1) !important;
}

.flatpickr-time .numInputWrapper span.arrow.up::after {
    border-bottom-color: var(--accent-color) !important;
}
.flatpickr-time .numInputWrapper span.arrow.down::after {
    border-top-color: var(--accent-color) !important;
}

.text-center {
    text-align: center !important;
}
