/*
 * Tokenlite Mobile Responsive & Video Background Styles
 * Professional Investment Platform Design
 * Dark Theme - Matching Main Page
 */

/* CSS Variables for Dark Theme - Matching Main Page */
:root {
    --primary-color: #f7931a;
    --secondary-color: #d4761a;
    --accent-color: #4ecdc4;
    --bg-dark: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #151515;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #2a2a2a;
    --border-light: #333333;
    --success-color: #4ade80;
    --warning-color: #ffc107;
    --danger-color: #ef4444;
    --info-color: #17a2b8;
    --gradient-primary: linear-gradient(135deg, #f7931a 0%, #f7931a 100%);
    --gradient-glow: radial-gradient(circle at center, rgba(247, 147, 26, 0.3) 0%, transparent 70%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(247, 147, 26, 0.3);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Base Responsive Typography */
html {
    font-size: 14px;
}

@media (min-width: 576px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Video Background Implementation */
.video-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: var(--bg-dark);
}

.video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.2;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

/* Mobile Video Background Optimization */
@media (max-width: 767px) {
    .video-background {
        display: none; /* Hide video on mobile for performance */
    }
    
    .video-background-container {
        background: var(--bg-dark);
    }
}

/* Enhanced Mobile Navigation */
@media (max-width: 991px) {
    .navbar-mobile {
        padding: 1rem 0;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }
    
    .navbar-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .navbar-menu > li {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .navbar-menu > li > a {
        padding: 1rem 1.5rem;
        border-radius: var(--border-radius);
        margin: 0.25rem 1rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        transition: var(--transition);
        color: var(--text-secondary);
    }
    
    .navbar-menu > li > a:hover,
    .navbar-menu > li.active > a {
        background: var(--primary-color);
        color: white;
        transform: translateX(4px);
    }
}

/* Mobile-First Card Design */
.card {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
    color: var(--text-primary);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

@media (max-width: 767px) {
    .card {
        margin-left: 1rem;
        margin-right: 1rem;
        border-radius: var(--border-radius);
    }
    
    .card-innr {
        padding: 1.25rem !important;
    }
}

/* Enhanced Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(247, 147, 26, 0.4);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 767px) {
    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn + .btn {
        margin-left: 0;
    }
}

/* Enhanced Form Controls */
.input-bordered,
.form-control,
select,
textarea {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
}

.input-bordered:focus,
.form-control:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
    background: var(--bg-secondary);
}

.input-bordered::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Mobile Form Optimization */
@media (max-width: 767px) {
    .input-bordered,
    .form-control,
    select,
    textarea {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: var(--border-radius);
    }
    
    .input-item {
        margin-bottom: 1.5rem;
    }
    
    .input-item-label {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.5rem;
        display: block;
    }
}

/* Enhanced Table Responsiveness */
.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    background: var(--bg-card);
    color: var(--text-primary);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

@media (max-width: 767px) {
    .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    .table,
    .table thead,
    .table tbody,
    .table th,
    .table td,
    .table tr {
        display: block;
    }
    
    .table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table tr {
        background: var(--bg-card);
        margin-bottom: 1rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
        overflow: hidden;
    }
    
    .table td {
        border: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding: 1rem 1rem 1rem 35%;
    }
    
    .table td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 30%;
        padding-right: 1rem;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* Enhanced Badge Styles */
.badge {
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.badge-success {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-primary {
    background: rgba(247, 147, 26, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(247, 147, 26, 0.3);
}

/* Enhanced Modal Responsiveness */
.modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
}

.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
    background: var(--bg-card);
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

@media (min-width: 992px) {
    .modal-lg {
        max-width: 800px;
    }
}

/* Enhanced Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
    border-color: rgba(74, 222, 128, 0.2);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
    border-color: rgba(255, 193, 7, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
    border-color: rgba(23, 162, 184, 0.2);
}

/* Text Color Fixes - Ensure Proper Contrast */
.text-white {
    color: white !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Fix white text on white background issues */
.bg-white .text-white,
.card .text-white,
.modal-content .text-white {
    color: var(--text-primary) !important;
}

.bg-primary .text-dark,
.btn-primary .text-dark {
    color: white !important;
}

/* Enhanced Responsive Grid */
@media (max-width: 575px) {
    .col-xs-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col, [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-bottom: 1rem;
    }
}

/* Enhanced Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.justify-content-end { justify-content: flex-end !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Responsive Display Classes */
@media (max-width: 575px) {
    .d-xs-none { display: none !important; }
    .d-xs-block { display: block !important; }
    .d-xs-flex { display: flex !important; }
}

@media (min-width: 576px) and (max-width: 767px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) and (max-width: 991px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-flex { display: flex !important; }
}

/* Print Styles */
@media print {
    .video-background-container {
        display: none;
    }
    
    .btn,
    .navbar,
    .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --border-light: #cccccc;
        --text-muted: #ffffff;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .video-background {
        display: none;
    }
}

/* Focus Management for Better Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 6px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced Touch Targets for Mobile */
@media (max-width: 767px) {
    .btn,
    .nav-link,
    .dropdown-item,
    .form-control,
    .input-bordered,
    select {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn-sm {
        min-height: 38px;
    }
    
    .btn-lg {
        min-height: 50px;
    }
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

/* Currency selection icons - comprehensive fix for dark theme visibility */
.token-choose-list,
.token-choose-item,
.token-method,
.payment-method-list .method-item,
.payment-methods .method-item,
.currency-list .currency-item {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.token-choose-item:hover,
.token-method:hover,
.payment-method-list .method-item:hover,
.payment-methods .method-item:hover,
.currency-list .currency-item:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
}

.token-choose-item .choose-icon,
.token-method .method-icon,
.payment-method-list .method-icon,
.payment-methods .method-icon,
.currency-list .currency-icon,
.method-icon,
.choose-icon,
.currency-icon {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Make currency icons visible by inverting them to white */
.token-choose-item .choose-icon img,
.token-method .method-icon img,
.payment-method-list .method-icon img,
.payment-methods .method-icon img,
.currency-list .currency-icon img,
.method-icon img,
.choose-icon img,
.currency-icon img {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

/* Alternative approach for SVG icons */
.token-choose-item .choose-icon svg,
.token-method .method-icon svg,
.payment-method-list .method-icon svg,
.payment-methods .method-icon svg,
.currency-list .currency-icon svg,
.method-icon svg,
.choose-icon svg,
.currency-icon svg {
    fill: var(--text-primary) !important;
    color: var(--text-primary) !important;
}

/* Fix for any generic payment/currency selection containers */
.payment-options,
.currency-options,
.token-options {
    background: transparent !important;
}

.payment-options .option,
.currency-options .option,
.token-options .option {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.payment-options .option:hover,
.currency-options .option:hover,
.token-options .option:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--primary-color) !important;
}

/* Fix for Buy Token page specifically */
.buy-token-page .token-choose-list,
.purchase-page .token-choose-list {
    background: transparent !important;
}

.buy-token-page .token-choose-item,
.purchase-page .token-choose-item {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.buy-token-page .token-choose-item:hover,
.purchase-page .token-choose-item:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
}

/* Ensure labels and text are visible */
.token-choose-item .choose-label,
.token-method .method-label,
.payment-method-list .method-label,
.payment-methods .method-label,
.currency-list .currency-label {
    color: var(--text-primary) !important;
}

/* Fix for any modal or dropdown currency selectors */
.modal .token-choose-list,
.dropdown .token-choose-list,
.modal .currency-list,
.dropdown .currency-list {
    background: var(--bg-card) !important;
}

.modal .token-choose-item,
.dropdown .token-choose-item,
.modal .currency-list .currency-item,
.dropdown .currency-list .currency-item {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.modal .token-choose-item:hover,
.dropdown .token-choose-item:hover,
.modal .currency-list .currency-item:hover,
.dropdown .currency-list .currency-item:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
}
