/* ========================================
   BTC OPTIONS SQUEEZE - DASHBOARD STYLES
   Premium gold/black professional aesthetic
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #d4af37;
    --text-secondary: #c9a961;
    --text-muted: #8a8a8a;
    --border-color: #d4af37;
    --accent-color: #d4af37;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --tradingview-color: #2962ff;
    --guide-color: #9c27b0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== HEADER ========== */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-weight: 300;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* ========== STATUS GRID ========== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
}

.status-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.status-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.status-value.green {
    color: var(--green);
}

.status-value.red {
    color: var(--red);
}

.status-value.yellow {
    color: var(--yellow);
}

/* ========== CONTROLS ========== */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn:hover {
    background: var(--border-color);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    border-color: var(--green);
}

.btn-secondary {
    border-color: var(--yellow);
    color: var(--yellow);
}

.btn-secondary:hover {
    background: var(--yellow);
}

.btn-danger {
    border-color: var(--red);
    color: var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

/* ========== POSITIONS & TRADES ========== */
.positions-section,
.trades-section {
    margin-bottom: 30px;
}

.positions-list,
.trades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.position-card,
.trade-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px;
}

.position-header,
.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tier-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.tier-bronze {
    background: #8B4513;
    color: white;
}

.tier-silver {
    background: #C0C0C0;
    color: black;
}

.tier-gold {
    background: #FFD700;
    color: black;
}

.position-details,
.trade-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: bold;
}

.pnl-positive {
    color: var(--green);
}

.pnl-negative {
    color: var(--red);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== FOOTER ========== */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-info span {
    margin: 0 8px;
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--border-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .position-details,
    .trade-details {
        grid-template-columns: 1fr;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.position-card,
.trade-card {
    animation: fadeIn 0.3s ease-out;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========== NEW BUTTONS ========== */
.btn-tradingview {
    background: var(--tradingview-color);
    border-color: var(--tradingview-color);
}

.btn-tradingview:hover {
    background: #1e53e5;
    border-color: #1e53e5;
}

.btn-guide {
    background: var(--guide-color);
    border-color: var(--guide-color);
}

.btn-guide:hover {
    background: #7b1fa2;
    border-color: #7b1fa2;
}

/* ========== TRADING GUIDE MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: auto;
    padding: 30px;
    border: 2px solid var(--border-color);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
}

.cheatsheet-content h1 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.cheatsheet-content h2 {
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.cheatsheet-content h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.cheatsheet-content p {
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.8;
}

.cheatsheet-content ul {
    list-style: none;
    padding-left: 0;
}

.cheatsheet-content li {
    color: var(--text-muted);
    padding: 5px 0;
    padding-left: 20px;
}

.cheatsheet-content li:before {
    content: "→ ";
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 5px;
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
}

.cheat-section {
    margin-bottom: 30px;
}

.tier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.gold-tier {
    border-left: 4px solid #dc3545;
}

.silver-tier {
    border-left: 4px solid #ff9800;
}

.bronze-tier {
    border-left: 4px solid #ffc107;
}

.cheat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.cheat-table th,
.cheat-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.cheat-table th {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: bold;
}

.cheat-table td {
    color: var(--text-muted);
}

.gold-row {
    background: rgba(220, 53, 69, 0.1);
}

.silver-row {
    background: rgba(255, 152, 0, 0.1);
}

.bronze-row {
    background: rgba(255, 193, 7, 0.1);
}
