/* G Trade Journal - Styles */

/* Reset & Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    background: #000000;
    min-height: 100vh;
}

/* Header */
header {
    background: #000000;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #222;
}

.header-spacer {
    flex: 1;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.logo {
    width: 200px;
    height: auto;
    margin-bottom: 12px;
    filter: brightness(1.2);
}

h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    letter-spacing: 2px;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
}

.header-buttons {
    display: flex;
    gap: 16px;
    white-space: nowrap;
    flex: 1;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    background: #0066ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #0055dd;
}

.btn.secondary {
    background: #333;
}

.btn.secondary:hover {
    background: #444;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Stats Grid */
.stats-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 30px 20px;
}

.stat-card {
    background: #111111;
    border-radius: 10px;
    padding: 16px 24px;
    width: 160px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid #222;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 30px 30px 30px;
}

th {
    text-align: left;
    padding: 14px 10px;
    font-weight: 600;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #222;
}

td {
    padding: 14px 10px;
    border-bottom: 1px solid #111;
    font-size: 14px;
}

tr:hover {
    background: #151515;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.badge-asia {
    background: #2d1b3a;
    color: #c9a7eb;
}

.badge-frankfurt {
    background: #3a2d1b;
    color: #e6b587;
}

.badge-london {
    background: #1a3a6e;
    color: #6eb5ff;
}

.badge-ny {
    background: #1e4d2b;
    color: #6dff8c;
}

.badge-long {
    background: #1e4d2b;
    color: #6dff8c;
}

.badge-short {
    background: #5e1c1c;
    color: #ff6b6b;
}

/* P/L Colors */
.pl-positive {
    color: #6dff8c;
    font-weight: 700;
}

.pl-negative {
    color: #ff6b6b;
    font-weight: 700;
}

.pl-zero {
    color: #aaaa00;
    font-weight: 700;
}

.win-take {
    color: #6dff8c;
    font-weight: 700;
}

.win-stop {
    color: #ff6b6b;
    font-weight: 700;
}

.win-be {
    color: #aaaa00;
    font-weight: 700;
}

/* Table Details */
.pair {
    font-weight: 700;
    color: #fff;
}

.date {
    color: #aaa;
    font-size: 13px;
}

.delete-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}

.delete-btn:hover {
    color: #ff4444;
}

.edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    margin-right: 4px;
}

.edit-btn:hover {
    color: #0066ff;
}

.actions-cell {
    white-space: nowrap;
}

.tv-link {
    color: #0066ff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.tv-link:hover {
    text-decoration: underline;
}

/* Auth Overlay */
#authOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#authOverlay.hidden {
    display: none;
}

.auth-box {
    background: #111;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 40px rgba(0,102,255,0.2);
}

.auth-box h2 {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
}

.auth-box input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.auth-box input::placeholder {
    color: #777;
}

.auth-box input:focus {
    outline: none;
    border-color: #0066ff;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-buttons .btn {
    flex: 1;
    padding: 12px;
}

.auth-msg {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.auth-msg.error {
    color: #ff4444;
}

.auth-msg.success {
    color: #4caf50;
}

.auth-msg.info {
    color: #aaa;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
}

.auth-links a {
    color: #0066ff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #3388ff;
    text-decoration: underline;
}

/* Delete Confirmation Modal */
#deleteConfirmOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

#deleteConfirmOverlay:not(.hidden) {
    display: flex !important;
}

.modal-box {
    background: #111;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 40px rgba(0,102,255,0.2);
    border: 1px solid #333;
    text-align: center;
}

.modal-box h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    color: #fff;
}

.modal-box p {
    margin: 0 0 24px 0;
    color: #aaa;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    min-width: 100px;
}

/* Add Form Modal */
#addFormOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

#addFormOverlay.active {
    display: flex;
}

#addForm {
    background: #111111;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 0 40px rgba(0,102,255,0.2);
    border: 1px solid #222;
}

/* Edit Form Modal */
#editFormOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

#editFormOverlay.active {
    display: flex;
}

#editForm {
    background: #111111;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 0 40px rgba(0,102,255,0.2);
    border: 1px solid #222;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.form-row > * {
    flex: 1 1 130px;
}

.form-row input,
.form-row select {
    padding: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 14px;
    background: #222;
    color: #fff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-actions button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.save-btn {
    background: #0066ff;
    color: white;
}

.cancel-btn {
    background: #333;
    color: #ccc;
}

/* Equity Chart */
#equityOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

#equityOverlay.active {
    display: flex;
}

.chart-container {
    position: relative;
    width: 90vw;
    max-width: 1400px;
    height: 80vh;
    background: #111;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0 40px rgba(0,102,255,0.2);
}

.chart-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
}

.chart-close-btn:hover {
    background: #555;
}

/* Share Modal */
#shareOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 20px;
}

#shareOverlay.active {
    display: flex;
}

.share-box {
    background: #111;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 0 40px rgba(0,102,255,0.2);
}

.share-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.share-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
}

.share-toggle label {
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #333;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #0066ff;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s;
}

.toggle-switch.active::after {
    left: 27px;
}

.share-link-box {
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    word-break: break-all;
    font-size: 13px;
    color: #6eb5ff;
    margin-bottom: 16px;
    cursor: pointer;
}

.share-link-box:hover {
    background: #222;
}

/* Utility Classes */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.hidden {
    display: none !important;
}

.view-only-banner {
    background: #1e4d2b;
    color: #6dff8c;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #222;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    .header-spacer {
        display: none;
    }

    .header-center {
        width: 100%;
        margin-bottom: 20px;
    }

    .logo {
        width: 150px;
    }

    h1 {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .header-buttons {
        width: 100%;
        flex: 0;
        justify-content: center;
        flex-wrap: wrap;
    }

    .stats-grid {
        padding: 20px 10px;
    }

    table {
        margin: 0 10px 20px 10px;
        font-size: 12px;
    }

    th, td {
        padding: 10px 6px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row > * {
        flex: 1 1 100%;
    }
}
