:root {
    --primary-blue: #A8D8FF;
    --secondary-blue: #E6F4FF;
    --pale-yellow: #fff4db;
    --accent-yellow: #FFE5A8;
    --accent-yellow-dark: #FFD470;
    --text-dark: #2C3E50;
    --text-black: #000000;
    --text-light: #6C7A89;
    --white: #FFFFFF;
    --dark-blue: #1E3A8A;
    --blur-amount: 4px;
    scroll-behavior: smooth;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.main-content {
    background: linear-gradient(180deg, var(--secondary-blue) 0%, var(--primary-blue) 100%);
    flex: 1;
    padding: 100px 20px 60px;
    min-height: 100%;
}

.calculator-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.calculator-container {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.header {
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    color: #1a1f36;
}

.header h1 {
    margin-left: 0;
}

.amount-field label, .duration-field label {
    font-size: 12px;
    color: #8792a2;
    margin-bottom: 4px;
    display: block;
}

.subtitle {
    display: none;
}

.input-fields {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.amount-field, .duration-field {
    flex: 1;
    position: relative;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    font-size: 18px;
    color: #1a1f36;
}

.currency, .unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8792a2;
    pointer-events: none;
    margin-top: 10px;
}

.amount-field input, .duration-field input {
    padding-right: 45px;
}

.results {
    background: #f5f6fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.result-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.risk-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.r-label {
    color: #1a1f36;
    font-size: 24px;
    font-weight: 600;
}

.label {
    color: #8792a2;
    font-size: 14px;
    margin-bottom: 5px;
}

.value {
    color: #1a1f36;
    font-size: 24px;
    font-weight: 600;
}

.explanation {
    color: #8792a2;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 12px;
    max-width: 280px;
}

.position-calculator {
    margin-top: 20px;
    border-top: 1px solid #e6e8eb;
    padding-top: 20px;
}

.positions-container {
    flex: 2;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.positions-container h1 {
    margin-bottom: 20px;
}

.symbol-entry {
    margin-bottom: 20px;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: start;
}

.symbol-field, .price-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-toggle-group {
    display: flex;
    flex-direction: column;
    margin-top: 0px;
    align-items: center;
    gap: 15px;
}

.symbol-field label, .price-field label, .price-toggle-group label {
    font-size: 12px;
    color: #8792a2;
}

.price-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2563eb;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.hidden {
    display: none;
}

.position-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr) 80px;
    gap: 15px;
    align-items: center;
    position: relative;
    background: #f5f6fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.position-row .field {
    display: flex;
    flex-direction: column;
}

.position-row .label {
    font-size: 12px;
    color: #8792a2;
    margin-bottom: 4px;
}

.position-row .value {
    font-size: 14px;
    color: #1a1f36;
    font-weight: 500;
}

.field.actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    flex-direction: row;
    min-width: 72px;
}

.add-symbol-btn {
    width: 100%;
    padding: 10px;
    background: none;
    border: 2px dashed #e6e8eb;
    border-radius: 8px;
    color: #8792a2;
    cursor: pointer;
    margin: 15px 0;
    transition: all 0.3s;
}

.add-symbol-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

/* Responsive layout */
@media (max-width: 1024px) {
    .calculator-wrapper {
        flex-direction: column;
    }

    .calculator-container {
        min-width: unset;
        max-width: unset;
    }

    .positions-container {
        flex: 1;
    }
}

.position-controls {
    display: none;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: -10px;
}

.refresh-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #2563eb;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s;
}

.refresh-button:hover {
    background: #e6e8eb;
}

.refresh-button.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.auto-update-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8792a2;
    cursor: pointer;
    font-size: 8pt
}

.position-row {
    transition: background-color 0.3s;
}

.position-row.updating {
    background-color: #e6f7ff;
}

.position-row.update-error {
    background-color: #fff2f0;
}

.error-message {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
}

.symbol-field {
    position: relative;
    width: 100%;
}

.symbol-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.symbol-search-results.hidden {
    display: none;
}

.search-result {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #e6e8eb;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background-color: #f5f6fa;
}

.search-error {
    padding: 10px;
    color: #ff4d4f;
}

.search-result .symbol {
    font-weight: 500;
    color: #1a1f36;
}

.search-result .name {
    font-size: 12px;
    color: #8792a2;
    margin-top: 2px;
}

.loading-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.loading-indicator.hidden {
    display: none;
    margin-top: 10px;
}

.loading-indicator .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e6e8eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-icon {
    font-size: 16px;
}

.search-result .type {
    font-size: 11px;
    color: #8792a2;
    margin-top: 2px;
}

/* Update symbol input to accommodate loading indicator */
.symbol-field input {
    padding-right: 36px;
}

/* Position size selector styles */
.position-size-field {
    position: relative;
}

.position-size-selector {
    position: relative;
    cursor: pointer;
    z-index: 1;
}

.position-size-selector.active {
    z-index: 1002;
}

.position-size-options {
    position: absolute;
    top: auto;
    bottom: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    display: none;
}

.position-size-selector:hover .position-size-options {
    display: none;
}

.position-size-options .option {
    padding: 8px 12px;
    transition: background-color 0.2s;
}

.position-size-options .option:hover {
    background-color: #f5f6fa;
}

.position-size-options .option.active {
    background-color: #e6f7ff;
    color: #2563eb;
}

/* Add indicator for hoverable element */
.position-size-selector .value {
    display: flex;
    align-items: center;
    gap: 4px;
}

.position-size-selector .value::after {
    content: '▼';
    font-size: 8px;
    color: #8792a2;
    margin-left: 4px;
}

.position-size-selector:hover .value::after {
    color: #2563eb;
}

.back-button {
    display: none;
}

/* Add styles for the page header */
.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 44px;
    color: #1a1f36;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 16px;
    color: #8792a2;
    margin-bottom: 30px;
}

/* Price levels button */
.price-levels-btn,
.delete-row-btn {
    background: none;
    border: none;
    color: #8792a2;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 32px;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.price-levels-btn:hover {
    background: #e6e8eb;
    color: #2563eb;
}

.delete-row-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Price levels card */
.price-levels-card {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 1002;
}

.price-levels-card.hidden {
    display: none;
}

.price-levels-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e6e8eb;
}

.price-levels-header .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #8792a2;
}

.price-levels-header .r-value {
    font-size: 14px;
    color: #8792a2;
}

.price-levels-header .symbol-container {
    background: #f5f6fa;
    border-radius: 12px;
    padding: 12px;
}

.price-levels-header .symbol-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.price-levels-header .symbol {
    font-size: 24px;
    font-weight: 600;
    color: #1a1f36;
}

.price-levels-header .status {
    font-size: 18px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.price-levels-header .status.profit {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.price-levels-header .status.loss {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.price-levels-container {
    position: relative;
    height: 250px;
    margin: 20px;
    padding-right: 15px;
}

.price-level {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateY(50%);
}

.price-level .line {
    width: 100%;
    height: 1px;
    background: #e6e8eb;
    margin-bottom: 4px;
}

.price-level .level-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.price-level .level-label {
    color: #8792a2;
}

.price-level .price-label {
    color: #1a1f36;
}

/* Level-specific styles */
.price-level.tp .line {
    background: #22c55e;
    height: 2px;
}

.price-level.entry .line {
    border-top: 2px dashed #8792a2;
    background: none;
    height: 0;
}

.price-level.sl .line {
    background: #ef4444;
    height: 2px;
}

.price-level.current .line {
    border-top: 2px dashed #2563eb;
    background: none;
    height: 0;
}

.price-level.current.profit .line {
    background: #22c55e;
}

.price-level.current.loss .line {
    background: #ef4444;
}

/* Update current price line styles when entry exists */
.price-level.current.with-entry .line {
    border-top: none;
    height: 1px;
}

.price-level.current.with-entry.profit .line {
    background: #22c55e;
}

.price-level.current.with-entry.loss .line {
    background: #ef4444;
}

/* Style for current price label */
.price-level.current.with-entry {
    /* Remove the default level info styling */
    transform: translateY(0);
}

.price-level.current.with-entry .level-info {
    position: absolute;
    left: -75px;  /* Extend outside the card */
    transform: translateY(-50%);
    color: white;
    padding: 6px 20px 7px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    /* Create the arrow/connector effect */
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}

.price-level.current.with-entry.profit .level-info {
    background: #22c55e;
}

.price-level.current.with-entry.loss .level-info {
    background: #ef4444;
}

/* Hide the "Current" label text */
.price-level.current.with-entry .level-label {
    display: none;
}

/* Center and style the price in the label */
.price-level.current.with-entry .price-label {
    color: white;
    font-weight: 500;
}

/* Add hover state for the entire row */
.position-row {
    cursor: pointer;
}

.position-row:hover {
    background: #f0f2f5;
}

/* Add styles for price change display */
.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-change {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.2;
}

.price-change.positive {
    color: #22c55e;
}

.price-change.negative {
    color: #ef4444;
}

/* Update price field to accommodate the change display */
.position-row .price-field {
    min-width: 180px;
}

/* Add styles for position row background colors */
.position-row.profit {
    background-color: rgba(34, 197, 94, 0.05);
}

.position-row.profit:hover {
    background-color: rgba(34, 197, 94, 0.1);
}

.position-row.loss {
    background-color: rgba(239, 68, 68, 0.05);
}

.position-row.loss:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Update symbol container background colors */
.price-levels-header .symbol-container.profit {
    background-color: rgba(34, 197, 94, 0.05);
}

.price-levels-header .symbol-container.loss {
    background-color: rgba(239, 68, 68, 0.05);
}

/* Update symbol container styles for position status */
.price-levels-header .position-status {
    font-size: 14px;
    color: #1a1f36;
    font-weight: 500;
}

.price-levels-header .per-share {
    font-size: 12px;
    color: #8792a2;
    margin-top: 4px;
}

/* Update status styles for position view */
.price-levels-header .symbol-container.profit .status {
    font-size: 18px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.price-levels-header .symbol-container.loss .status {
    font-size: 18px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Ensure SVGs are centered in buttons */
.price-levels-btn svg,
.delete-row-btn svg {
    display: block;
    margin: auto;
}

/* Add Bootstrap-style button */
.export-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 10px auto 0;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background-color: #0b5ed7;
}

.export-btn svg {
    margin-right: 8px;
}

.symbol-link {
    text-decoration: none;
    color: #1a1f36;
    transition: color 0.2s;
}

.symbol-link:hover {
    color: #2563eb;
}

/* Navigation header */
.nav-header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 32px;
    height: 32px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 500;
    color: #1a1f36;
}

.nav-button {
    background: #ffd25e;
    color: #1a1f36;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-button:hover {
    background: #ffb300;
}

.nav-button:hover {
    background: #ffe082;
}

/* Footer styles */
.footer {
    background-color: #fff6e5;
    padding: 60px 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-logo-img {
    width: 32px;
    height: 32px;
}

.footer-logo span {
    font-size: 18px;
    font-weight: 500;
    color: #1a1f36;
}

.footer-text {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 400px;
}

.back-to-top {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
}

.back-to-top:hover {
    color: #1a1f36;
}

.footer-middle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-section h3 {
    color: #1a1f36;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-section a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin-bottom: 12px;
}

.footer-section a:hover {
    color: #1a1f36;
}

.footer-right h3 {
    color: #1a1f36;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-right a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

.footer-right a:hover {
    color: #1a1f36;
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: #64748b;
    font-size: 14px;
}

/* Footer styles */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-text {
        margin: 20px auto;
    }

    .footer-middle {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

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

@media (max-width: 480px) {
    .footer {
        padding: 40px 0;
    }

    .footer-content {
        gap: 30px;
    }

    .footer-bottom {
        margin-top: 30px;
    }
}

/* Legal pages styling */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.legal-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.legal-container .last-updated {
    color: #64748b;
    margin-bottom: 30px;
}

.legal-container section {
    margin-bottom: 40px;
}

.legal-container h2 {
    font-size: 24px;
    color: #1a1f36;
    margin-bottom: 15px;
}

.legal-container p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 15px;
}

.legal-container ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.legal-container li {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 8px;
}

.legal-container a {
    color: #2563eb;
    text-decoration: none;
}

.legal-container a:hover {
    text-decoration: underline;
} 