/* Mobile Responsive Styles */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --spacing-base: 20px;
    --spacing-sm: 12px;
    --spacing-xs: 8px;
    --card-radius: 12px;
    --touch-target: 44px;
    --bottom-nav-height: 56px;
}

/* ========================================
   Tablet Breakpoint (481-768px)
   ======================================== */
@media (max-width: 768px) {
    :root {
        --spacing-base: 16px;
        --spacing-sm: 10px;
    }

    /* Hide less important table columns */
    .hide-tablet {
        display: none !important;
    }
}

/* ========================================
   Mobile Breakpoint (≤480px)
   ======================================== */
@media (max-width: 480px) {
    :root {
        --spacing-base: 12px;
        --spacing-sm: 8px;
        --spacing-xs: 4px;
        --card-radius: 8px;
    }

    /* Utility classes */
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .show-mobile-flex {
        display: flex !important;
    }

    /* Body padding for bottom nav */
    body {
        padding-bottom: var(--bottom-nav-height);
    }

    /* Full width inputs */
    input[type="text"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        width: 100% !important;
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    /* Touch-friendly buttons */
    .btn {
        min-height: var(--touch-target);
        padding: 12px 16px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 8px 12px;
    }
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #16181c;
    border-top: 1px solid #2f3336;
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #8b98a5;
    text-decoration: none;
    font-size: 10px;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.bottom-nav-item:hover,
.bottom-nav-item:active {
    color: #e7e9ea;
}

.bottom-nav-item.active {
    color: #1d9bf0;
}

.bottom-nav-icon {
    font-size: 20px;
}

.bottom-nav-label {
    font-weight: 500;
}

@media (max-width: 480px) {
    .bottom-nav {
        display: flex;
    }

    /* Hide top tab navigation on mobile */
    .tab-nav {
        display: none !important;
    }

    /* Adjust content for bottom nav */
    .tab-content {
        margin-bottom: 0;
        border-radius: 8px 8px 0 0;
    }
}

/* ========================================
   Mobile Card Component
   ======================================== */
.mobile-card {
    background: #1a1d21;
    border-radius: var(--card-radius);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border: 1px solid #2f3336;
}

.mobile-card:active {
    background: #1c1f23;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
}

.mobile-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #e7e9ea;
    flex: 1;
    line-height: 1.4;
    word-break: break-word;
}

.mobile-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 6px 0;
    border-bottom: 1px solid #2f3336;
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    color: #8b98a5;
    font-size: 12px;
}

.mobile-card-value {
    font-size: 14px;
    font-weight: 500;
    color: #e7e9ea;
    font-family: 'Courier New', monospace;
}

.mobile-card-footer {
    display: flex;
    gap: 8px;
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
    border-top: 1px solid #2f3336;
}

.mobile-card-footer .btn {
    flex: 1;
    justify-content: center;
}

/* ========================================
   Price Display for Mobile
   ======================================== */
.mobile-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
    margin: var(--spacing-xs) 0;
}

.mobile-price-box {
    background: #0f1419;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.mobile-price-platform {
    font-size: 11px;
    color: #8b98a5;
    margin-bottom: 4px;
}

.mobile-price-value {
    font-size: 18px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.mobile-price-value.yes {
    color: #00ba7c;
}

.mobile-price-volume {
    font-size: 10px;
    color: #6b7280;
    margin-top: 4px;
}

.mobile-diff-box {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
    background: #0f1419;
    padding: 8px;
    border-radius: 6px;
}

.mobile-diff-item {
    text-align: center;
}

.mobile-diff-label {
    font-size: 10px;
    color: #8b98a5;
}

.mobile-diff-value {
    font-size: 16px;
    font-weight: bold;
}

.mobile-diff-value.positive {
    color: #00ba7c;
}

.mobile-diff-value.negative {
    color: #f91880;
}

/* ========================================
   Mobile Header Adjustments
   ======================================== */
@media (max-width: 480px) {
    .app-header {
        border-radius: 0;
        margin-bottom: 0;
    }

    .header-top {
        padding: 12px 15px;
        flex-direction: row;
        align-items: center;
    }

    .app-title {
        font-size: 18px;
    }

    .app-subtitle {
        display: none;
    }

    .header-right {
        gap: 10px;
    }

    .user-info {
        padding: 4px 8px;
    }

    .user-name {
        display: none;
    }

    .lang-toggle {
        padding: 4px 8px;
        font-size: 12px;
    }
}
