* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    background-color: #000000;
    color: #E8E8E8;
    font-size: 20px;
    line-height: 1.4;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    min-height: 100vh;
}

/* Auth Screen */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

/* Auth Illustration (Left Side) */
.auth-illustration {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.auth-title {
    font-size: 48px;
    color: #FFD700;
    text-align: center;
    letter-spacing: 2px;
    line-height: 1.2;
}

.pixel-art {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    border: 3px solid #FFD700;
    background-color: #1a1a1a;
}

.pixel-art svg {
    width: 100%;
    height: auto;
}

.auth-tagline {
    font-size: 24px;
    color: #E8E8E8;
    text-align: center;
    max-width: 400px;
}

/* Auth Forms (Right Side) */
.auth-forms {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    border: 3px solid #FFD700;
    padding: 30px;
    background-color: #1a1a1a;
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .auth-illustration {
        display: none;
    }
}

.title {
    font-size: 48px;
    color: #FFD700;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: 2px;
}

.auth-form h2 {
    font-size: 32px;
    color: #FFD700;
    margin-bottom: 20px;
    text-align: center;
}

.auth-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #000;
    border: 2px solid #E8E8E8;
    color: #E8E8E8;
    font-family: 'VT323', monospace;
    font-size: 20px;
}

.auth-form input:focus {
    outline: none;
    border-color: #FFD700;
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
}

.auth-switch span {
    color: #FFD700;
    cursor: pointer;
    text-decoration: underline;
}

.auth-switch span:hover {
    color: #FFF;
}

.error-message {
    color: #ff4444;
    margin-top: 10px;
    text-align: center;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon {
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    cursor: pointer;
    border: 2px solid;
    background-color: #000;
    transition: all 0.2s;
}

.btn-primary {
    color: #000;
    background-color: #FFD700;
    border-color: #FFD700;
    width: 100%;
}

.btn-primary:hover {
    background-color: #FFF;
    border-color: #FFF;
}

.btn-secondary {
    color: #E8E8E8;
    border-color: #E8E8E8;
}

.btn-secondary:hover {
    color: #FFD700;
    border-color: #FFD700;
}

.btn-icon {
    color: #FFD700;
    border-color: #FFD700;
    padding: 5px 15px;
    min-width: 40px;
}

.btn-icon:hover {
    color: #FFF;
    border-color: #FFF;
}

/* App Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    border-bottom: 3px solid #FFD700;
    background-color: #1a1a1a;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 70%;
    padding: 0 20px;
}

@media (max-width: 1199px) {
    .header-content {
        max-width: 100%;
    }
}

.header h1 {
    font-size: 36px;
    color: #FFD700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right span {
    color: #E8E8E8;
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* Responsive: Limit width on large screens */
@media (min-width: 1200px) {
    .main-container {
        max-width: 70%;
    }
}

@media (max-width: 1199px) {
    .main-container {
        max-width: 100%;
    }
}

/* Top Section: Form + Calendar */
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Trade Form */
.trade-form-container {
    border: 3px solid #FFD700;
    padding: 20px;
    background-color: #1a1a1a;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.form-header h2 {
    font-size: 28px;
    color: #FFD700;
    margin: 0;
}

.editing-badge {
    font-size: 20px;
    color: #000;
    background-color: #FFD700;
    padding: 4px 12px;
    border: 2px solid #FFD700;
    font-weight: bold;
    letter-spacing: 1px;
}

.trade-form-container h2 {
    font-size: 28px;
    color: #FFD700;
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #FFD700;
    margin-bottom: 5px;
    font-size: 18px;
}

.time-link {
    color: #FFD700;
    font-size: 16px;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.time-link:hover {
    color: #FFF;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px;
    background-color: #000;
    border: 2px solid #E8E8E8;
    color: #E8E8E8;
    font-family: 'VT323', monospace;
    font-size: 18px;
}

/* Hide number input spinners/arrows */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

#leverage::-webkit-inner-spin-button,
#leverage::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#leverage {
    -moz-appearance: textfield;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FFD700;
}

.form-group textarea {
    resize: vertical;
}

.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
    height: 40px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #E8E8E8;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.pl-display {
    padding: 10px;
    margin: 15px 0;
    background-color: #000;
    border: 2px solid #FFD700;
    text-align: center;
    font-size: 24px;
    min-height: 45px;
}

.pl-display.positive {
    color: #4CAF50;
}

.pl-display.negative {
    color: #ff4444;
}

/* Calendar */
.calendar-container {
    border: 3px solid #FFD700;
    padding: 20px;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-header h2 {
    font-size: 28px;
    color: #FFD700;
}

#calendar {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 15px;
    min-width: 0;
}

.calendar-day-header {
    text-align: center;
    color: #FFD700;
    padding: 5px;
    font-size: 18px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #E8E8E8;
    background-color: #000;
    cursor: pointer;
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.calendar-day:hover {
    border-color: #FFD700;
    background-color: #1a1a1a;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    background-color: #1a1a1a;
    border-color: #FFD700;
}

.calendar-day.selected {
    background-color: #FFD700;
    color: #000;
    border-color: #FFD700;
}

.calendar-day.selected .trade-count {
    color: #000;
}

.calendar-day.has-trades {
    border: 2px solid #FFD700;
}

.trade-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 14px;
    color: #FFD700;
}

/* Bottom Section: Sidebar + Content */
.bottom-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    flex: 1;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    padding: 15px;
    background-color: #1a1a1a;
    border: 2px solid #E8E8E8;
    color: #E8E8E8;
    font-family: 'VT323', monospace;
    font-size: 20px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.nav-item:hover {
    border-color: #FFD700;
    color: #FFD700;
}

.nav-item.active {
    background-color: #FFD700;
    color: #000;
    border-color: #FFD700;
}

/* Content Area */
.content-area {
    border: 3px solid #FFD700;
    padding: 20px;
    background-color: #1a1a1a;
    overflow-y: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view h2 {
    font-size: 32px;
    color: #FFD700;
    margin-bottom: 20px;
}

.view h3 {
    font-size: 24px;
    color: #FFD700;
    margin-bottom: 10px;
}

.date-picker {
    padding: 10px;
    background-color: #000;
    border: 2px solid #E8E8E8;
    color: #E8E8E8;
    font-family: 'VT323', monospace;
    font-size: 20px;
    margin-bottom: 20px;
}

.date-picker:focus {
    outline: none;
    border-color: #FFD700;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    border: 2px solid #E8E8E8;
    padding: 15px;
    background-color: #000;
}

.stat-label {
    color: #FFD700;
    font-size: 18px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 32px;
    color: #E8E8E8;
}

.stat-value.positive {
    color: #4CAF50;
}

.stat-value.negative {
    color: #ff4444;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chart-box {
    border: 2px solid #E8E8E8;
    padding: 15px;
    background-color: #000;
}

.chart-box canvas {
    max-height: 300px;
}

/* Trade List */
#trades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trade-item {
    border: 2px solid #E8E8E8;
    padding: 15px;
    background-color: #000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
}

.trade-item:hover {
    border-color: #FFD700;
}

.trade-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trade-coin {
    font-size: 24px;
    color: #FFD700;
}

.trade-direction {
    font-size: 18px;
}

.trade-direction.LONG {
    color: #4CAF50;
}

.trade-direction.SHORT {
    color: #ff4444;
}

.trade-details {
    font-size: 16px;
    color: #aaa;
}

.trade-pl {
    font-size: 28px;
    font-weight: bold;
    min-width: 120px;
    text-align: right;
}

.trade-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid #E8E8E8;
    background-color: #000;
    color: #E8E8E8;
}

.btn-small:hover {
    border-color: #FFD700;
    color: #FFD700;
}

.btn-delete {
    border-color: #ff4444;
    color: #ff4444;
}

.btn-delete:hover {
    background-color: #ff4444;
    color: #000;
}

/* Trade Highlights */
.trade-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.highlight-column {
    border: 2px solid #E8E8E8;
    padding: 15px;
    background-color: #000;
}

.highlight-item {
    padding: 10px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
}

.highlight-item:last-child {
    border-bottom: none;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-text {
    font-size: 48px;
    color: #FFD700;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

#user-name {
    cursor: pointer;
    transition: color 0.2s;
}

#user-name:hover {
    color: #FFD700;
}

/* Responsive */
@media (max-width: 1200px) {
    .top-section {
        grid-template-columns: 1fr;
    }

    .bottom-section {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .title {
        font-size: 32px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    #calendar {
        gap: 2px;
    }

    .calendar-day {
        font-size: 16px;
    }

    .trade-item {
        grid-template-columns: 1fr;
    }

    .trade-highlights {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #FFD700;
    border: 2px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #FFF;
}

/* Week Buttons */
.week-btn {
    padding: 8px 16px;
    background-color: #000;
    color: #E8E8E8;
    border: 2px solid #E8E8E8;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 20px;
    transition: all 0.2s;
}

.week-btn:hover {
    background-color: #1a1a1a;
    border-color: #FFD700;
    color: #FFD700;
}

.week-btn.active {
    background-color: #FFD700;
    border-color: #FFD700;
    color: #000;
    font-weight: bold;
}

.week-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
