/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --link-color: #77bbff;  /* Standard link blue color */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #CCCCCC;
    background-color: #000000;
}

/* Header styles */
header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: 80px; /* Add minimum height */
}

header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin: 0;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
    max-width: 50%; /* Limit width to prevent overflow */
}

/* Header controls container */
.header-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-left: auto; /* Push to the right end */
}

/* Language switcher */
.language-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    height: 32px; /* Fixed height */
    align-items: center; /* Center items vertically */
    width: 100px; /* Fixed width */
}

/* Mobile language switcher - shown by default */
.mobile-lang-switcher {
    margin-left: auto; /* Ensure it's at the rightmost position */
}

/* Desktop language switcher - hidden by default */
.desktop-lang-switcher {
    display: none;
}

/* Navigation language switcher container */
.nav-lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

/* Navigation search container */
.nav-search-container {
    display: flex;
    align-items: right;
    margin-left: 1rem;
}

.nav-search-container .desktop-search-container {
    margin: 0;
    flex: none;
    min-width: 300px;
    max-width: 350px;
}

/* Desktop search container - hidden by default (mobile first) */
.desktop-search-container {
    display: none;
    height: 44px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.25rem;
    margin: 0 1rem;
    min-width: 300px;
    max-width: 350px;
    flex: 1;
}

#desktop-search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
    border-radius: 20px;
}

#desktop-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.desktop-search-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    min-width: 32px;
    min-height: 32px;
}

.desktop-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn {
    background: transparent;
    color: white;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    width: 50px; /* Fixed width */
    height: 28px; /* Fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* Prevent text wrapping */
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: white;
    color: #2196F3;
    font-weight: 600;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(255,255,255,0.2);
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0rem;
    margin: 0;
    margin-right: 0rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    display: block;
    min-height: 44px; /* Touch-friendly target */
    display: flex;
    align-items: center;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Main content */
main {
    margin: 0;
    padding: 2rem;
    width: 100%;
    margin-top: 0px; /* Reduced from 80px to 60px */
}

.title-section {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.title-section h2 {
    color: #2196F3;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    display: inline-block;
}

.title-section .description {
    color: #999999;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-left: 1rem;
    display: inline-block;
}

.section {
    display: none;
    background: #1a1a1a;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #333;
    width: 100%; /* Ensure full width */
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 3px solid #2196F3;
    padding-bottom: 0.5rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #1976D2 0%, #0b1e31 100%);
    color: #DDDDDD;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-weight: bold;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    /* Make text responsive and fit container */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    /* Use clamp for responsive font sizing */
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #DDDDDD;  /* Changed from #FFFFFF to #2196F3 (blue) */
}

.stat-value {
    font-size: 0.9rem;
    font-weight: normal;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* Chart styles */
.chart-container {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid #333;
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chart-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-height: 44px; /* Touch-friendly */
    min-width: 44px;
}

.chart-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.chart-btn.active {
    background: #1565C0;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

/* Table styles */
.table-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

#search-input, #sort-select {
    padding: 0.75rem;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #1a1a1a;
    color: #CCCCCC;
    min-height: 44px; /* Touch-friendly */
}

#search-input {
    flex: 1;
    min-width: 200px;
}

#search-input:focus, #sort-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

#search-input::placeholder {
    color: #666;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    background: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Ensure minimum width for scrolling */
    table-layout: fixed; /* Fix column widths */
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #333;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Break long words */
}

/* Set specific widths for different columns */
#cash-table th:nth-child(1), /* Name */
#cash-table td:nth-child(1) {
    width: 200px;
}

#cash-table th:nth-child(2), /* Symbol */
#cash-table td:nth-child(2) {
    width: 100px;
}

#cash-table th:nth-child(3), /* Price */
#cash-table td:nth-child(3) {
    width: 120px;
}

#cash-table th:nth-child(4), /* Market Cap */
#cash-table td:nth-child(4) {
    width: 150px;
}

#cash-table th:nth-child(5), /* Volume */
#cash-table td:nth-child(5) {
    width: 150px;
}

#cash-table th:nth-child(6), /* Change */
#cash-table td:nth-child(6) {
    width: 100px;
}

/* Time field formatting */
.time-field {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.time-field .date {
    font-size: 0.9em;
    color: #888;
}

.time-field .time {
    font-size: 0.9em;
    color: #888;
}

/* Detail table styles */
.detail-container {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    background: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

/* TX Detail Container Styles */
.tx-detail-container {
    padding: 1.5rem;
}

.main-table-container {
    margin-bottom: 2rem;
}

.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #333, transparent);
    margin: 2rem 0;
}

.cash-tables-section {
    margin-top: 2rem;
}

.cash-tables-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.cash-table-wrapper {
    flex: 1;
    min-width: 300px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #333;
    overflow: hidden;
}

.cash-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 -1.5rem; /* Negative margin to align with container padding */
}

.cash-table-wrapper th,
.cash-table-wrapper td {
    padding: 0.75rem 1.5rem; /* Adjust horizontal padding to match container padding */
    border-bottom: 1px solid #333;
    white-space: normal;
    word-wrap: break-word;
}

.cash-table-wrapper th:last-child,
.cash-table-wrapper td:last-child {
    border-right: none;
}

.cash-table-wrapper h3 {
    margin-bottom: 1rem;
    color: #2196F3;
    font-size: 1.2rem;
    font-weight: 600;
}

.detail-table-unified th {
    color: #2196F3;
    font-weight: 600;
    width: 200px;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #333;
    white-space: normal;
    word-wrap: break-word;
}

.detail-table-unified td {
    padding: 0.75rem;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-height: 44px; /* Touch-friendly */
    min-width: 44px;
}

.pagination button:hover:not(:disabled) {
    background: #1976D2;
}

.pagination button:disabled {
    background: #666;
    cursor: not-allowed;
}

#page-info {
    font-weight: 500;
    color: #CCCCCC;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: #777777;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid #333;
}

/* Responsive design */
/* Mobile First - Small devices (phones, 600px and down) */
@media (max-width: 600px) {
    body {
        padding-top: 60px; /* Adjust padding for mobile header */
    }

    header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        height: auto; /* Change from fixed height to auto */
        min-height: 60px; /* Set minimum height */
    }
    
    header h1 {
        font-size: 1.5rem;
        flex: 1;
        max-width: 60%; /* Increase max-width for mobile */
    }
    
    .header-controls {
        order: 2;
        gap: 0.5rem;
    }
    
    .language-switcher {
        height: 28px; /* Slightly smaller height for mobile */
        width: 90px; /* Slightly smaller width for mobile */
    }
    
    .lang-btn {
        padding: 0.25rem 0.6rem;
        font-size: 0.75rem;
        width: 45px; /* Slightly smaller width for mobile */
        height: 24px; /* Slightly smaller height for mobile */
    }
    
    .menu-toggle {
        display: block;
        margin-left: 1rem;
    }
    
    nav {
        width: 100%;
        order: 3;
        position: fixed;
        bottom: 60px; /* Adjust to match bottom bar height */
        left: 0;
        right: 0;
        z-index: 999;
        pointer-events: none;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.95);
        margin: 0;
        border-radius: 8px 8px 0 0;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.3s ease, max-height 0.3s ease;
        pointer-events: none;
        position: relative;
        z-index: 1000;
    }
    
    nav ul.active {
        max-height: 300px;
        padding: 0.5rem 0;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    nav.active {
        pointer-events: auto; /* Enable clicks when menu is open */
    }
    
    nav a {
        padding: 0.75rem 1rem; /* Increase padding for better touch target */
        white-space: nowrap; /* Keep text in one line */
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: right;
        justify-content: flex-end;
        color: #cccccc;
        text-decoration: none;
    }
    
    nav a:last-child {
        border-bottom: none;
    }
    
    main {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    
    .section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .stat-card h3 {
        font-size: clamp(1.3rem, 3.5vw, 1.8rem);
        margin-bottom: 0.3rem;
        line-height: 1.1;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .chart-controls {
        gap: 0.5rem;
    }
    
    .chart-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: auto;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #search-input {
        min-width: auto;
        width: 100%;
    }
    
    th, td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination button {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Mobile Bottom Bar */
    .mobile-bottom-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0.75rem 1rem;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
        height: 60px; /* Add fixed height */
    }

    .mobile-search-container {
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        padding: 0.25rem;
        width: 80%;
        min-width: 250px;
        margin-right: 1rem;
        color: #cccccc;
    }

    .mobile-search-container[style*="display: none"] ~ .mobile-menu-toggle {
        margin-left: auto;
    }

    #mobile-search-input {
        background: transparent;
        border: none;
        color: #cccccc;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        flex: 1;
        outline: none;
        border-radius: 20px;
    }

    #mobile-search-input::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

    .mobile-search-btn {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: #cccccc;
        padding: 0.5rem;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s ease;
        min-width: 32px;
        min-height: 32px;
    }

    .mobile-search-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: transparent;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        transition: background-color 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-menu-toggle .hamburger {
        width: 20px;
        height: 2px;
        background: cccccc;
        margin: 2px 0;
        transition: 0.3s;
        border-radius: 2px;
    }

    .mobile-menu-toggle.active .hamburger:nth-child(1) {
        transform: rotate(-45deg) translate(-4px, 4px);
    }

    .mobile-menu-toggle.active .hamburger:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .hamburger:nth-child(3) {
        transform: rotate(45deg) translate(-4px, -4px);
    }

    /* Hide desktop language switcher on mobile */
    .desktop-lang-switcher {
        display: none;
    }
    
    .nav-lang-switcher {
        display: none;
    }

    /* Add bottom padding to main content to account for fixed bottom bar */
    main {
        padding-bottom: 80px;
    }

    /* Add bottom padding to footer to prevent overlap with bottom bar */
    footer {
        padding-bottom: 60px;
    }

    .desktop-search-container {
        display: none !important;
    }
}

/* Tablet - Medium devices (tablets, 768px and down) */
@media (min-width: 601px) and (max-width: 768px) {
    body {
        padding-top: 70px; /* Adjust padding for tablet header */
    }

    header {
        height: auto; /* Change from fixed height to auto */
        min-height: 70px; /* Set minimum height */
    }
    
    header h1 {
        font-size: 2rem;
        max-width: 55%; /* Adjust max-width for tablet */
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-btn {
        flex: 1;
    }
}

/* Large tablets and small laptops */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-top: 80px; /* Adjust padding for larger screens */
    }

    header {
        height: auto; /* Change from fixed height to auto */
        min-height: 80px; /* Set minimum height */
    }
    
    main {
        padding: 0 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    header h1 {
        max-width: 50%; /* Adjust max-width for larger screens */
    }
}

/* Hide mobile menu toggle on larger screens */
@media (min-width: 601px) {
    .menu-toggle {
        display: none;
    }
    
    nav ul {
        display: flex !important;
        max-height: none !important;
        background: none !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    /* Hide mobile bottom bar on larger screens */
    .mobile-bottom-bar {
        display: none;
    }
    
    /* Hide mobile language switcher and show desktop one */
    .mobile-lang-switcher {
        display: none;
    }
    
    .desktop-lang-switcher {
        display: flex;
    }
    
    /* Show desktop search container on larger screens */
    .desktop-search-container {
        display: flex;
    }
}

/* Desktop - Large screens (desktops, 1025px and up) */
@media (min-width: 1025px) {
    body {
        padding-top: 80px; /* Consistent padding for desktop */
    }

    header {
        height: 80px; /* Consistent height for desktop */
    }
    
    .stat-card h3 {
        font-size: clamp(1.2rem, 2vw, 1.5rem);
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra small screens (less than 360px) */
@media (max-width: 359px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        min-height: 100px;
    }
    
    .stat-card h3 {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem);
        margin-bottom: 0.25rem;
        line-height: 1.0;
    }
    
    .stat-value {
        font-size: 0.75rem;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #2196F3;
    font-size: 1.1rem;
}

.error {
    background: #4a1a1a;
    color: #ff6b6b;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #ff4757;
    border: 1px solid #333;
}

/* Field name styling */
#cash-table th {
    color: #2196F3;
    font-weight: 600;
}

/* Toast notification styles */
.toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #555555;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 4px;
    border: 1px solid #333333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    max-width: 300px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Desktop toast styles */
@media (min-width: 601px) {
    .toast-container {
        top: 100px; /* Position below header */
        right: 20px;
    }
}

/* Mobile toast styles */
@media (max-width: 600px) {
    .toast-container {
        bottom: 80px; /* Position above bottom bar */
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
    }

    .toast {
        width: 100%;
        max-width: none;
        text-align: center;
        transform: translateY(100%);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 500;
}

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

.boolean-true {
    color: #4CAF50;
    font-weight: bold;
}

.boolean-false {
    color: #F44336;
    font-weight: bold;
}

/* Unified style for all list page table headers */
.list-table th {
    color: #2196F3;
    font-weight: 600;
}

@media (max-width: 768px) {
    .detail-table-unified th,
    .detail-table-unified td {
        padding: 12px;
        font-size: 0.85rem;
    }
    .detail-table-unified th {
        width: 120px;
    }
}

/* Cash Tables Container Styles */
.cash-tables-container {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.cash-table-wrapper {
    flex: 1;
    min-width: 300px;
}

.cash-table-wrapper h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .cash-tables-container {
        flex-direction: column;
        gap: 1rem;
    }

    .cash-table-wrapper {
        width: 100%;
    }
}

/* QR Code Icon */
.qr-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    cursor: pointer;
    fill: #2196F3;
    transition: fill 0.3s ease;
}

.qr-icon:hover {
    fill: #1976D2;
}

/* QR Code Modal */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.qr-modal-content {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 10px;
    position: relative;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border: 1px solid #333;
}

.qr-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qr-container canvas {
    max-width: 100%;
    height: auto;
    background: #AAAAAA;
}

.qr-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(33, 150, 243, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
}

.qr-nav-btn:hover:not(:disabled) {
    background: rgba(33, 150, 243, 0.4);
}

.qr-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prev-btn {
    left: -20px;
}

.next-btn {
    right: -20px;
}

.qr-page-indicator {
    color: #CCCCCC;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.qr-close-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    min-width: 100px;
}

.qr-close-btn:hover {
    background: #1976D2;
}

/* Mobile styles for QR modal */
@media (max-width: 600px) {
    .qr-modal-content {
        width: 95%;
        padding: 1rem;
    }

    .qr-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .prev-btn {
        left: -16px;
    }

    .next-btn {
        right: -16px;
    }

    .qr-close-btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Section Container Styles */
.section-container {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

#home {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.section-container h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 3px solid #2196F3;
    padding-bottom: 0.5rem;
}

#swap {
    display: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
    width: 100%;
}

#swap.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

/* Dropdown Menu Styles */
.developer-dropdown,
.tools-dropdown {
    display: none;
    position: absolute;
    background-color: #333333;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    border: 1px solid #444444;
    overflow: hidden;
}

.developer-dropdown a,
.tools-dropdown a {
    color: #cccccc;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #444444;
}

.developer-dropdown a:last-child,
.tools-dropdown a:last-child {
    border-bottom: none;
}

.developer-dropdown a:hover,
.tools-dropdown a:hover {
    background-color: #444444;
    color: #ffffff;
}

/* Mobile Dropdown Styles */
@media (max-width: 600px) {
    .developer-dropdown,
    .tools-dropdown {
        position: fixed !important;
        bottom: 70px !important; /* Position above mobile bottom bar with 10px gap */
        left: 50% !important;
        transform: translateX(-50%) translateY(100%) !important; /* Start below viewport */
        min-width: 280px;
        max-width: 90vw;
        background-color: #1a1a1a;
        border: none !important; /* Remove blue border */
        border-radius: 12px;
        box-shadow: 0px 10px 30px 0px rgba(0,0,0,0.5);
        z-index: 1001; /* Higher than backdrop */
        display: none;
        margin: 0 !important;
        padding: 0 !important;
        top: auto !important; /* Remove top positioning */
        transition: transform 0.3s ease-out !important;
    }

    .developer-dropdown.show,
    .tools-dropdown.show {
        transform: translateX(-50%) translateY(0) !important; /* Slide to final position */
    }

    .developer-dropdown a,
    .tools-dropdown a {
        padding: 16px 20px;
        font-size: 1.1rem;
        text-align: center;
        border-bottom: 1px solid #333333;
        color: #cccccc;
        text-decoration: none;
        display: block;
        transition: background-color 0.3s ease;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .developer-dropdown a:last-child,
    .tools-dropdown a:last-child {
        border-bottom: none;
    }

    .developer-dropdown a:hover,
    .tools-dropdown a:hover {
        background-color: #2196F3;
        color: #ffffff;
    }

    .developer-dropdown a:active,
    .tools-dropdown a:active {
        background-color: #1976D2;
        color: #ffffff;
    }

    /* Mobile dropdown backdrop */
    .dropdown-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 1000;
        display: none;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0;
        transition: opacity 0.3s ease-out;
    }

    .dropdown-backdrop.active {
        display: block !important;
        opacity: 1;
    }
}

/* Desktop Dropdown Styles */
@media (min-width: 601px) {
    .developer-dropdown,
    .tools-dropdown {
        top: 100%;
        left: 0;
        margin-top: 5px;
    }

    /* Ensure parent elements have relative positioning */
    nav li {
        position: relative;
    }
} 