/* OddBall.Systems Arctic Professional Trading Dashboard CSS - Mobile Optimized */
/* Save this file as: oddball-arctic.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #2563eb;
    --light-blue: #60a5fa;
    --dark-blue: #1e3a8a;
    --accent-orange: #fb923c;
    --bright-orange: #f97316;
    --success: #10b981;
    --danger: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.5);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(251, 146, 60, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
    z-index: -2;
    animation: backgroundShift 20s ease infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    33% { transform: scale(1.1) rotate(120deg); }
    66% { transform: scale(0.9) rotate(240deg); }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(37, 99, 235, 0.02) 35px, rgba(37, 99, 235, 0.02) 70px);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
}

/* Header Styles - Full Width Mobile */
header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(30, 58, 138, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    text-align: center;
    width: 100%;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-orange), var(--primary-blue));
    animation: slideGradient 3s ease infinite;
}

@keyframes slideGradient {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

h1 {
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--text-primary), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    letter-spacing: -1px;
    text-align: center;
}

.website-link {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.3);
    margin-top: 10px;
}

.website-link:hover {
    background: rgba(251, 146, 60, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(251, 146, 60, 0.2);
}

.refresh-indicator {
    position: absolute;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent-orange), var(--bright-orange));
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.4);
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(251, 146, 60, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(251, 146, 60, 0.6);
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(37, 99, 235, 0.1));
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 146, 60, 0.1), transparent);
    transition: left 0.6s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(251, 146, 60, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(251, 146, 60, 0.2);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: 600;
}

.stat-value {
    font-size: 42px;
    font-weight: 800;
    font-family: 'Inter', monospace;
    line-height: 1;
}

.stat-value.positive {
    background: linear-gradient(135deg, var(--success), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.stat-value.negative {
    background: linear-gradient(135deg, var(--danger), #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.stat-value.highlight {
    background: linear-gradient(135deg, var(--accent-orange), var(--bright-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(251, 146, 60, 0.3);
}

/* Live Position Section */
.live-position {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(249, 115, 22, 0.1));
    border: 2px solid var(--accent-orange);
    border-radius: 24px;
    padding: 35px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    animation: liveGlow 2s infinite;
    width: 100%;
}

@keyframes liveGlow {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(251, 146, 60, 0.3),
            inset 0 0 20px rgba(251, 146, 60, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(251, 146, 60, 0.5),
            inset 0 0 30px rgba(251, 146, 60, 0.15);
    }
}

.live-position::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(251, 146, 60, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.live-position h2 {
    color: var(--accent-orange);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.live-position h2::before {
    content: '●';
    color: var(--accent-orange);
    animation: blink 1s infinite;
    font-size: 24px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Table Styles */
h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 40px 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Table wrapper for horizontal scrolling on mobile */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 0 10px;
    width: calc(100% + 20px);
}

table {
    width: 100%;
    min-width: 500px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

thead {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(251, 146, 60, 0.2));
}

th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-orange);
    border-bottom: 2px solid rgba(251, 146, 60, 0.3);
}

/* Tighter direction column */
th:nth-child(3) {
    padding-right: 5px;
    width: 70px;
}

td {
    padding: 18px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tighter direction column cells */
td:nth-child(3) {
    padding-right: 5px;
    width: 70px;
}

tbody tr {
    transition: all 0.3s;
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

tr.profit {
    background: rgba(16, 185, 129, 0.05);
    border-left: 4px solid var(--success);
}

tr.loss {
    background: rgba(239, 68, 68, 0.05);
    border-left: 4px solid var(--danger);
}

/* Direction Badges - No right margin */
.direction {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    display: inline-block;
    text-transform: uppercase;
    margin-right: 0;
}

.direction.long {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.direction.short {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Price and P/L Formatting */
.price {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-weight: 600;
    color: var(--light-blue);
    font-size: 14px;
    letter-spacing: 0.5px;
}

.pl {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 15px;
}

.pl.positive {
    color: var(--success);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.pl.negative {
    color: var(--danger);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Disclaimer Section - Full Width */
.disclaimer {
    margin-top: 60px;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-card), rgba(251, 146, 60, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
}

.disclaimer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--danger), var(--accent-orange));
}

.disclaimer h3 {
    color: var(--accent-orange);
    font-size: 16px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-align: center;
}

.disclaimer p {
    margin-bottom: 15px;
    text-align: justify;
    opacity: 0.9;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.disclaimer strong {
    color: var(--accent-orange);
    font-weight: 700;
}

/* ========================================
   MOBILE RESPONSIVE DESIGN - IPHONE OPTIMIZED
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 10px;
        width: 100%;
    }
    
    header {
        padding: 20px 15px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 22px;
        letter-spacing: -0.5px;
        word-wrap: break-word;
        padding: 0 10px;
    }
    
    .website-link {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .refresh-indicator {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 9px;
        letter-spacing: 0.5px;
    }
    
    h2 {
        font-size: 18px;
        margin: 25px 0 15px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .stat-label {
        font-size: 10px;
        letter-spacing: 1px;
        margin-bottom: 6px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .live-position {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .live-position h2 {
        font-size: 16px;
        gap: 8px;
    }
    
    .live-position h2::before {
        font-size: 16px;
    }
    
    /* TABLE MOBILE OPTIMIZATION */
    .table-wrapper {
        margin: 0 -5px;
        padding: 0 5px;
        width: calc(100% + 10px);
    }
    
    table {
        font-size: 11px;
        min-width: 100%;
        border-radius: 12px;
    }
    
    th {
        padding: 10px 6px;
        font-size: 9px;
        letter-spacing: 0.5px;
    }
    
    /* Even tighter direction column header on mobile */
    th:nth-child(3) {
        padding-right: 2px;
        width: 55px;
    }
    
    td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    /* Even tighter direction column cells on mobile */
    td:nth-child(3) {
        padding-right: 2px;
        width: 55px;
    }
    
    /* Ultra-compact direction badges */
    .direction {
        padding: 3px 6px;
        font-size: 8px;
        letter-spacing: 0.3px;
        border-radius: 5px;
    }
    
    /* Smaller price and P/L text */
    .price {
        font-size: 11px;
        letter-spacing: 0;
    }
    
    .pl {
        font-size: 12px;
    }
    
    /* Thinner borders on mobile */
    tr.profit,
    tr.loss {
        border-left-width: 2px;
    }
    
    .disclaimer {
        padding: 15px;
        font-size: 11px;
        border-radius: 12px;
    }
    
    .disclaimer h3 {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .disclaimer p {
        font-size: 11px;
        padding: 0 5px;
    }
}

/* iPhone SE and smaller phones */
@media (max-width: 375px) {
    .container {
        padding: 8px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    .refresh-indicator {
        display: none; /* Hide on very small screens to save space */
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Ultra-compact table for small iPhones */
    table {
        font-size: 10px;
    }
    
    th {
        padding: 8px 4px;
        font-size: 8px;
    }
    
    th:nth-child(3) {
        width: 48px;
    }
    
    td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    td:nth-child(3) {
        width: 48px;
    }
    
    /* Hide time column on very small screens */
    th:nth-child(2),
    td:nth-child(2) {
        display: none;
    }
    
    .direction {
        padding: 2px 4px;
        font-size: 7px;
        border-radius: 3px;
    }
    
    .price {
        font-size: 10px;
    }
    
    .pl {
        font-size: 10px;
    }
}

/* iPhone Pro Max and larger phones */
@media (min-width: 414px) and (max-width: 768px) {
    /* Slightly larger sizes for bigger phones */
    table {
        min-width: 100%;
    }
    
    th {
        padding: 12px 8px;
        font-size: 10px;
    }
    
    td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .direction {
        padding: 4px 8px;
        font-size: 9px;
    }
}

/* iOS-specific adjustments */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Prevent text size adjustment on iOS */
    body {
        -webkit-text-size-adjust: 100%;
    }
    
    /* Better tap targets for iOS */
    .direction {
        min-height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 15px 20px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--accent-orange));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-orange), var(--primary-blue));
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading {
    background: linear-gradient(90deg, var(--bg-card) 0%, rgba(251, 146, 60, 0.1) 50%, var(--bg-card) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}