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

/* Catgirl Decorations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.catgirl-left,
.catgirl-right {
    position: fixed;
    bottom: 0;
    width: 450px;
    height: 800px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    pointer-events: auto;
    opacity: 0.9;
    z-index: 100;
    animation: float 3s ease-in-out infinite;
    transition: filter 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.catgirl-left:hover,
.catgirl-right:hover {
    animation: none;
    transform: scale(1.12) translateY(-15px);
    filter: drop-shadow(0 0 20px rgba(255, 150, 200, 0.7));
    opacity: 1;
}

.catgirl-left {
    left: 10px;
    background-image: url('/static/catgirl-left.png');
}

.catgirl-right {
    right: 10px;
    background-image: url('/static/catgirl-right.png');
}

@media (max-width: 1600px) {
    .catgirl-left,
    .catgirl-right {
        width: 350px;
        height: 620px;
        opacity: 0.75;
    }
}

@media (max-width: 1400px) {
    .catgirl-left,
    .catgirl-right {
        width: 280px;
        height: 500px;
        opacity: 0.6;
    }
}

@media (max-width: 1300px) {
    .catgirl-left,
    .catgirl-right {
        display: none;
    }

    .catgirl-mobile {
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
        width: 100%;
    }

    .catgirl-mobile img {
        width: 100%;
        max-width: 400px;
        height: auto;
        border-radius: 12px;
        opacity: 0.95;
        filter: drop-shadow(0 0 20px rgba(255, 150, 200, 0.6));
    }
}

@media (min-width: 1301px) {
    .catgirl-mobile {
        display: none;
    }
}

/* Aurora Animation */
@keyframes aurora {
    0%, 100% {
        background-position: 0% 50%, 100% 50%, 50% 100%;
    }
    25% {
        background-position: 100% 50%, 0% 100%, 0% 0%;
    }
    50% {
        background-position: 50% 100%, 50% 0%, 100% 50%;
    }
    75% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #050508;
    color: #e0e0e0;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    font-size: 14px;
    letter-spacing: -0.01em;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(16, 185, 129, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 30%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 50%);
    animation: aurora 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 50% 80% at 70% 60%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 40% 60% at 30% 70%, rgba(6, 182, 212, 0.2) 0%, transparent 50%);
    animation: aurora 20s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 400;
}

/* Config Section */
.config-section {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.config-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.config-row label {
    color: #888;
    font-size: 0.9rem;
}

.config-row input {
    flex: 1;
    min-width: 300px;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.config-row input:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

button {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8) 0%, rgba(6, 182, 212, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

button:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 1) 0%, rgba(6, 182, 212, 1) 100%);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.5), 0 0 40px rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}

button:disabled {
    background: rgba(30, 30, 35, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    cursor: not-allowed;
}

.status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #888;
}

.status.error {
    color: #ff6b6b;
}

.status.success {
    color: #4caf50;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    background: rgba(15, 15, 20, 0.7);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0;
}

.stat-value {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-value.positive {
    color: #4caf50;
}

.stat-value.negative {
    color: #ff6b6b;
}

/* Trades Section */
.trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.trades-section h2 {
    font-size: 1rem;
    color: #9ca3af;
    margin: 0;
    font-weight: 500;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input[type="date"] {
    padding: 0.4rem 0.75rem;
    background: rgba(15, 15, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:focus,
.filters input[type="date"]:focus {
    outline: none;
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.filters input[type="date"] {
    color-scheme: dark;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.date-input-wrapper label {
    color: #888;
    font-size: 0.75rem;
    font-weight: 500;
}

.quick-filters {
    display: flex;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.quick-btn {
    padding: 0.4rem 0.6rem;
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #888;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: rgba(30, 30, 35, 0.7);
    color: #fff;
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.quick-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.7) 0%, rgba(236, 72, 153, 0.7) 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

/* Positions Section */
.positions-section {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.positions-section h2 {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    font-weight: 500;
}

.positions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.position-card {
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    transition: all 0.3s ease;
}

.position-card:hover {
    background: rgba(25, 25, 30, 0.7);
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.position-card.long {
    border-left-color: #4caf50;
}

.position-card.short {
    border-left-color: #ff6b6b;
}

.position-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.position-asset {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.position-direction {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.position-direction.long {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.position-direction.short {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.position-details {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.position-detail {
    display: flex;
    flex-direction: column;
}

.position-detail .label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
}

.position-detail .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: #ccc;
}

.position-detail .value.positive {
    color: #4caf50;
}

.position-detail .value.negative {
    color: #ff6b6b;
}

/* Chart Section */
.chart-section {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-section h2 {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    font-weight: 500;
}

.chart-container {
    height: 250px;
    position: relative;
}

/* Comparison Section */
.comparison-section {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.comparison-section h2 {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    font-weight: 500;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.comparison-card {
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.comparison-card:hover {
    background: rgba(25, 25, 30, 0.7);
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(16, 185, 129, 0.1);
}

.comparison-card h3 {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comp-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comp-label {
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 400;
}

.comp-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
}

.change-card .comp-value.positive {
    color: #22c55e;
}

.change-card .comp-value.negative {
    color: #ef4444;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.trades-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-state {
    color: #666;
    text-align: center;
    padding: 3rem;
}

/* Trade Card */
.trade-card {
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 1rem;
    border-left: 3px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trade-card:hover {
    background: rgba(15, 15, 20, 0.7);
    transform: translateY(-3px);
    border-color: rgba(236, 72, 153, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(236, 72, 153, 0.1);
}

.trade-card.long {
    border-left-color: #4caf50;
}

.trade-card.short {
    border-left-color: #ff6b6b;
}

/* Trade Summary - Always visible */
.trade-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trade-summary .trade-asset {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    min-width: 100px;
}

.trade-summary .trade-direction {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

.trade-summary .trade-pnl {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    min-width: 90px;
}

.trade-summary .trade-pnl.positive {
    color: #4caf50;
}

.trade-summary .trade-pnl.negative {
    color: #ff6b6b;
}

.trade-summary .trade-date {
    color: #666;
    font-size: 0.85rem;
    margin-left: auto;
}

.expand-icon {
    color: #666;
    font-size: 0.75rem;
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.trade-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Trade Details - Hidden by default */
.trade-details {
    display: none !important;
}

.trade-card.expanded .trade-details {
    display: block !important;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    font-size: 0.85rem;
    max-width: 600px;
}

.trade-details .notes-btn {
    margin-top: 0.75rem;
    width: auto;
    display: inline-block;
}

.trade-details .trade-notes-preview {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    max-width: 600px;
}

.market-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.market-badge.spot {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.trade-direction {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

.trade-direction.long {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.trade-direction.short {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.trade-detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    color: #6b7280;
    font-size: 0.7rem;
    text-transform: none;
    font-weight: 400;
}

.detail-value {
    color: #e5e7eb;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.detail-value.positive {
    color: #4caf50;
}

.detail-value.negative {
    color: #ff6b6b;
}

.notes-btn {
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    box-shadow: none;
}

.notes-btn:hover {
    background: rgba(30, 30, 35, 0.7);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
    transform: translateY(-1px);
}

.notes-btn.has-notes {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1rem;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
    background: none;
}

.modal-body {
    padding: 1rem;
}

.modal-body textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    background: rgba(15, 15, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.modal-body textarea:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}
