/* CSS Variables for Theme System */
:root {
    /* Current RS3 Brown Theme */
    --bg-gradient-start: #2d1810;
    --bg-gradient-mid: #3d2218;
    --bg-gradient-end: #4d2c20;
    --text-primary: #f4e6d7;
    --text-secondary: rgba(244, 230, 215, 0.8);
    --text-muted: rgba(244, 230, 215, 0.6);
    --accent-primary: #f7861b;
    --accent-secondary: #b55e0c;
    --accent-tertiary: #7a3f08;
    --surface-primary: rgba(122, 63, 8, 0.3);
    --surface-secondary: rgba(122, 63, 8, 0.2);
    --border-primary: rgba(181, 94, 12, 0.4);
    --border-secondary: rgba(181, 94, 12, 0.3);
    --header-bg-start: rgba(122, 63, 8, 0.9);
    --header-bg-end: rgba(181, 94, 12, 0.8);
    --header-border: rgba(247, 134, 27, 0.4);
}

/* Alternative Blue/Gold Theme */
:root[data-theme="blue-gold"] {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-mid: #16213e;
    --bg-gradient-end: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    --accent-primary: #ffd700;
    --accent-secondary: #ffed4e;
    --accent-tertiary: #16213e;
    --surface-primary: rgba(255, 255, 255, 0.12);
    --surface-secondary: rgba(255, 255, 255, 0.08);
    --border-primary: rgba(255, 215, 0, 0.3);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --header-bg-start: rgba(255, 255, 255, 0.15);
    --header-bg-end: rgba(255, 255, 255, 0.08);
    --header-border: rgba(255, 215, 0, 0.4);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Unified Tooltip System - JavaScript-based with theme support */
[data-tooltip] {
    cursor: help;
}

/* Theme-specific tooltip styles are now handled by JavaScript */

/* Responsive tooltip adjustments are now handled by JavaScript */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid var(--header-border);
    border-top: 1px solid var(--border-secondary);
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    position: relative;
    min-height: 120px;
    max-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-tertiary), 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0.1;
    border-radius: 0;
    z-index: -1;
    transition: all 0.3s ease;
}

.header-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    z-index: 1;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px var(--accent-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
    filter: drop-shadow(0 2px 4px var(--accent-tertiary));
    transition: all 0.3s ease;
}

.header h1 i {
    color: var(--accent-primary);
    margin-right: 0.75rem;
    filter: drop-shadow(0 2px 4px var(--accent-primary));
    animation: subtle-glow 3s ease-in-out infinite alternate;
    transition: all 0.3s ease;
}

@keyframes subtle-glow {
    0% { filter: drop-shadow(0 2px 4px var(--accent-primary)); opacity: 0.8; }
    100% { filter: drop-shadow(0 2px 8px var(--accent-primary)); opacity: 1; }
}

.header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px var(--accent-tertiary);
    transition: all 0.3s ease;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Search Section */
.search-section {
    background: var(--surface-primary);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px var(--surface-secondary);
    transition: all 0.3s ease;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-row {
    display: flex;
    gap: 0.75rem;
    align-items: end;
}

.search-field {
    flex: 1;
}

.search-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.search-field input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid var(--border-secondary);
    border-radius: 5px;
    background: var(--surface-secondary);
    color: var(--text-primary);
    font-size: 16px; /* Prevent zoom on iOS */
    transition: all 0.3s ease;
    /* Prevent zoom on iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Prevent zoom on iOS */
    -webkit-text-size-adjust: 100%;
}

.search-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface-secondary);
    transition: all 0.3s ease;
    /* Prevent zoom on iOS */
    font-size: 16px;
    /* Ensure proper focus behavior on mobile */
    -webkit-tap-highlight-color: transparent;
    /* Prevent zoom on iOS */
    -webkit-text-size-adjust: 100%;
}

.search-field input::placeholder {
    color: rgba(244, 230, 215, 0.6);
    /* Prevent zoom on iOS */
    font-size: 16px;
}

/* Search Suggestions */
.search-input-container {
    position: relative;
    /* Ensure proper positioning on mobile */
    z-index: 1002;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: none;
    /* Ensure suggestions are visible on mobile */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Ensure smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

.search-suggestions.show {
    display: block;
    /* Ensure suggestions are visible on mobile */
    animation: fadeIn 0.2s ease-in-out;
}

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

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Ensure touch targets are easily tappable */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* Ensure proper touch behavior */
    -webkit-tap-highlight-color: transparent;
    /* Ensure proper touch feedback */
    transition: all 0.1s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* Mobile-specific hover improvements */
@media (hover: none) {
    .suggestion-item:hover {
        background: transparent;
    }
}

.suggestion-item.selected {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

/* Mobile-specific selection improvements */
@media (hover: none) {
    .suggestion-item.selected {
        background: rgba(255, 215, 0, 0.15);
    }
}

.suggestion-icon {
    color: #8a9ba8;
    font-size: 0.9rem;
    /* Ensure proper icon display on mobile */
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    /* Ensure proper text display on mobile */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-price {
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 500;
    /* Ensure proper price display on mobile */
    flex-shrink: 0;
    text-align: right;
}

.suggestion-sprite {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    flex-shrink: 0;
    /* Ensure proper image display on mobile */
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
}

.suggestion-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 0.5rem;
    /* Ensure proper layout on mobile */
    min-width: 0;
}

.suggestion-text-container {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    /* Ensure proper text container layout on mobile */
    flex: 1;
    min-width: 0;
}

.suggestion-id {
    color: #8a9ba8;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    /* Ensure proper ID display on mobile */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-search-label {
    font-size: 0.75rem;
    color: #4ade80;
    margin-left: 0.5rem;
    font-style: italic;
    /* Ensure proper label display on mobile */
    flex-shrink: 0;
}

.recent-trade-label {
    font-size: 0.75rem;
    color: #f59e0b;
    margin-left: 0.5rem;
    font-style: italic;
    /* Ensure proper label display on mobile */
    flex-shrink: 0;
}

.dropdown-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.dropdown-item-text {
    flex: 1;
}

/* Infinite Scroll Loading Indicator */
.loading-more {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-more .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-more p {
    color: #8a9ba8;
    font-size: 0.9rem;
    margin: 0;
}

.search-btn {
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    color: #f4e6d7;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2), 0 3px 8px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-btn:active {
    transform: translateY(0);
}

/* Filter Section */
.filter-section {
    border-top: 1px solid rgba(181, 94, 12, 0.3);
    padding-top: 0.75rem;
}

.filter-group h3 {
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.filter-item input,
.filter-item select {
    padding: 0.5rem;
    border: 2px solid var(--border-secondary);
    border-radius: 5px;
    background: var(--surface-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface-secondary);
    transition: all 0.3s ease;
}

.filter-item input::placeholder {
    color: rgba(244, 230, 215, 0.6);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #f4e6d7;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2), 0 3px 8px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    color: rgba(244, 230, 215, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.03);
    font-weight: 400;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f4e6d7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 255, 255, 0.08);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    background: var(--surface-primary);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px var(--surface-secondary);
    transition: all 0.3s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(181, 94, 12, 0.3);
}

.results-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.results-info span:first-child {
    font-weight: 600;
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

.results-info span:last-child {
    font-size: 0.9rem;
    color: rgba(244, 230, 215, 0.7);
}

.results-actions {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
}

@media (max-width: 600px) {
    .results-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
}

/* Loading and Error States */
.loading-container,
.error-container {
    text-align: center;
    padding: 1.5rem 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.error-container i {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.no-results {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #8a9ba8;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.no-results h3 {
    margin-bottom: 0.5rem;
    color: #b8c5d6;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.results-table th,
.results-table td {
    padding: 0.625rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-table th {
    background: var(--surface-secondary);
    font-weight: 600;
    color: var(--accent-primary);
    position: sticky;
    top: 0;
    transition: all 0.3s ease;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.results-table th:hover {
    background: rgba(122, 63, 8, 0.6);
    color: #f4e6d7;
}

.results-table th::after {
    content: ' ↕';
    opacity: 0.3;
    font-size: 0.8em;
    margin-left: 0.5rem;
}

.results-table th:hover::after {
    opacity: 0.7;
}

/* Multi-column sort indicators */
.results-table th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #4ade80;
}

.results-table th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #f59e0b;
}

.results-table th.sort-priority::before {
    content: attr(data-priority);
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    color: #2d1810;
    font-size: 0.7em;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 2px;
    min-width: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Favorites table sort indicators */
.favorites-table th[data-sort] {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}

.favorites-table th[data-sort]:hover {
    background: rgba(255, 255, 255, 0.1);
}

.favorites-table th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #4ade80;
}

.favorites-table th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #f59e0b;
}

.favorites-table th.sort-priority::before {
    content: attr(data-priority);
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    color: #2d1810;
    font-size: 0.7em;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 2px;
    min-width: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.results-table tr:hover {
    background: rgba(122, 63, 8, 0.15);
}

.results-table td {
    color: #f4e6d7;
}

.item-name {
    font-weight: 500;
    color: #f4e6d7;
    cursor: pointer;
    transition: color 0.3s ease;
}

.item-name:hover {
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

.item-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-sprite {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}



.price-value {
    font-weight: 600;
    color: #4ade80;
}

.volume-value {
    font-weight: 600;
    color: #60a5fa;
}

.limit-value {
    font-weight: 600;
    color: #f59e0b;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #f4e6d7;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-info {
    font-weight: 500;
    color: #b8c5d6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 100%);
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    border: 1px solid var(--border-primary);
    box-shadow: 0 20px 60px var(--accent-tertiary);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-secondary);
    transition: border-color 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-item-sprite {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.modal-header h2 {
    color: var(--accent-primary);
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.item-details-table {
    margin-bottom: 0.75rem;
}

.item-details-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.item-details-table td {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-details-table tr:last-child td {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #b8c5d6;
    width: 30%;
}

.detail-value {
    font-weight: 600;
    color: #ffffff;
    width: 20%;
}

.item-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.item-links h3 {
    color: #ffd700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.links-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: space-between;
}

.external-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #b8c5d6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.external-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.external-link i {
    font-size: 1.1rem;
    color: #ffd700;
}

.price-history-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-history-section h3 {
    color: #ffd700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
        min-height: 100px;
        max-height: 120px;
    }
    
    .header h1 {
        font-size: 2rem;
        letter-spacing: -0.01em;
    }
    
    .header h1 i {
        margin-right: 0.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem; /* Add gap between search field and button on mobile */
    }
    
    .search-field {
        position: relative;
        z-index: 1002; /* Ensure search field is above suggestions */
    }
    
    .search-input-container {
        position: relative;
        z-index: 1002;
    }
    
    .search-btn {
        /* Ensure proper button sizing on mobile */
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        /* Ensure proper touch behavior on mobile */
        -webkit-tap-highlight-color: transparent;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .results-table {
        font-size: 0.9rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .item-sprite {
        width: 28px;
        height: 28px;
    }
    
    .suggestion-sprite {
        width: 20px;
        height: 20px;
        border-radius: 3px;
    }
    
    .chart-container {
        height: 250px;
        padding: 0.75rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 98%;
        max-width: none;
    }
    
    .item-details-table table {
        font-size: 0.9rem;
    }
    
    .item-details-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .links-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .external-link {
        justify-content: flex-start;
    }
    
    .modal-item-sprite {
        width: 36px;
        height: 36px;
    }
    
    .search-suggestions {
        max-height: 150px;
        /* Ensure suggestions are properly positioned on mobile */
        z-index: 1001;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        /* Ensure suggestions are visible on small screens */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Ensure suggestions are visible on mobile */
        border-radius: 0 0 6px 6px;
    }
    
    .suggestion-item {
        padding: 0.5rem 0.75rem;
    }
    
    .suggestion-price {
        font-size: 0.8rem;
    }
    
    /* Ensure search suggestions are visible on very small screens */
    .search-suggestions {
        max-height: 160px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Ensure suggestions are visible on very small screens */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1001;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        /* Ensure suggestions are visible on very small screens */
        border-radius: 0 0 4px 4px;
    }
    
    /* Ensure search field is properly sized on very small screens */
    .search-field input {
        font-size: 16px;
        padding: 0.875rem;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.25rem 0;
        min-height: 90px;
        max-height: 110px;
    }
    
    .header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.375rem;
    }
    
    .header h1 i {
        margin-right: 0.375rem;
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .search-section,
    .results-section {
        padding: 1.5rem;
    }
    
    .results-table {
        font-size: 0.8rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(181, 94, 12, 0.3);
}

.tab-btn {
    background: none;
    border: none;
    color: rgba(244, 230, 215, 0.7);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: #f4e6d7;
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #f4e6d7;
    border-bottom-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tracking Tab Styles */
.add-trade-section,
.profit-overview-section,
.recent-trades-section {
    background: rgba(122, 63, 8, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(181, 94, 12, 0.4);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-header h2 {
    color: var(--accent-primary);
    margin: 0;
    display: flex;
    transition: color 0.3s ease;
    align-items: center;
    gap: 0.375rem;
    font-size: 1.1rem;
}

.section-header p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Trade Form */
.trade-form {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 0.5rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.15);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Searchable Dropdown */
.searchable-dropdown {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.dropdown-list.show {
    display: block;
}

.dropdown-item {
    padding: 0.75rem;
    cursor: pointer;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 215, 0, 0.2);
}

.dropdown-item.selected {
    background: rgba(255, 215, 0, 0.3);
    border-left: 3px solid #ffd700;
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* DropdownManager Styles */
.dropdown-manager {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: var(--surface-secondary, rgba(26, 26, 46, 0.95)) !important;
    border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.2)) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    display: none !important;
    /* Override existing search-suggestions styles */
    border-top: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.2)) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-overflow-scrolling: touch !important;
}

.dropdown-manager.show {
    display: block !important;
    /* Ensure smooth animation */
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-manager .dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    cursor: pointer !important;
    color: var(--text-primary, white) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: background 0.2s ease !important;
    /* Override existing suggestion-item styles */
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.dropdown-manager .dropdown-item:hover {
    background: rgba(255, 215, 0, 0.2) !important;
}

.dropdown-manager .dropdown-item.selected {
    background: rgba(255, 215, 0, 0.3) !important;
    border-left: 3px solid #ffd700 !important;
}

.dropdown-manager .dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-sprite {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dropdown-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dropdown-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.dropdown-price {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.125rem;
}

.recent-search-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    flex-shrink: 0;
    font-style: italic;
}

.recent-trade-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 215, 0, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    flex-shrink: 0;
    font-style: italic;
}

/* Mobile responsive styles for dropdown */
@media (max-width: 768px) {
    .dropdown-manager {
        max-height: 250px;
    }
    
    .dropdown-manager .dropdown-item {
        padding: 0.875rem;
        gap: 0.625rem;
    }
    
    .dropdown-sprite {
        width: 28px;
        height: 28px;
    }
    
    .dropdown-name {
        font-size: 0.9rem;
    }
    
    .dropdown-price {
        font-size: 0.8rem;
    }
}

/* Trade Type Toggle */
.trade-type-toggle {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.toggle-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f4e6d7;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.toggle-btn.active:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
}

.toggle-btn i {
    font-size: 0.8rem;
}

/* Responsive styles for toggle */
@media (max-width: 768px) {
    .trade-type-toggle {
        flex-direction: row;
    }
    
    .toggle-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .toggle-btn i {
        font-size: 0.75rem;
    }
}

/* Tax View Toggle Switch */
.tax-view-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.toggle-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: #ffd700;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(32px);
}

.toggle-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    z-index: 1;
    transition: 0.3s;
}

.toggle-text-left {
    color: rgba(255, 255, 255, 0.6);
}

.toggle-text-right {
    color: rgba(255, 255, 255, 0.6);
}

.toggle-switch input:checked ~ .toggle-slider .toggle-text-left {
    color: rgba(255, 255, 255, 0.6);
}

.toggle-switch input:checked ~ .toggle-slider .toggle-text-right {
    color: rgba(255, 255, 255, 0.9);
}

.toggle-switch input:not(:checked) ~ .toggle-slider .toggle-text-left {
    color: rgba(255, 255, 255, 0.9);
}

.toggle-switch input:not(:checked) ~ .toggle-slider .toggle-text-right {
    color: rgba(255, 255, 255, 0.6);
}

/* Mobile responsive for tax view toggle */
@media (max-width: 768px) {
    .tax-view-toggle {
        margin-right: 0.5rem;
    }
    
    .toggle-label {
        font-size: 0.8rem;
    }
    
    .toggle-switch {
        width: 50px;
        height: 24px;
    }
    
    .toggle-slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(26px);
    }
    
    .toggle-text {
        font-size: 0.65rem;
    }
}

/* Profit Stats */
.profit-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    min-width: 0;
    transition: all 0.2s ease;
    cursor: help;
    position: relative;
}

.stat-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

.stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.375rem;
}

.stat-value {
    display: block;
    color: #ffd700;
    font-size: 1rem;
    font-weight: 600;
}

/* Chart Container */
.chart-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 350px;
    position: relative;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* General Quick Stats Layout */
.quick-stats {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Profit Summary in Trade History */
#history-profit-summary {
    margin-bottom: 1.5rem;
}

#history-profit-summary .quick-stats {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Trades Table */
.trades-actions {
    display: flex;
    gap: 1rem;
}

.trade-filters {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.trade-filters .filter-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.trade-filters .filter-item {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-direction: row;
}

.trade-filters .filter-item .filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffd700;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    margin: 0;
}

.trade-filters .filter-item .filter-label i {
    font-size: 0.8rem;
}

.trade-filters .filter-item .search-input-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.trade-filters .filter-item input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.trade-filters .filter-item input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.trade-filters .filter-item input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.trade-filters .filter-actions {
    display: flex;
    gap: 0.5rem;
}

.trades-table-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.trades-table th {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.trades-table th[data-sort]:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #ffffff;
}

.trades-table th[data-sort]::after {
    content: ' ↕';
    opacity: 0.3;
    font-size: 0.8em;
    margin-left: 0.5rem;
}

.trades-table th[data-sort]:hover::after {
    opacity: 0.7;
}

/* Trade table multi-column sort indicators */
.trades-table th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #4ade80;
}

.trades-table th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #f59e0b;
}

.trades-table th.sort-priority::before {
    content: attr(data-priority);
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ffd700;
    color: #1a1a1a;
    font-size: 0.7em;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 2px;
    min-width: 12px;
    text-align: center;
}

.trades-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trades-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.trade-type {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.trade-type.buy {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.trade-type.sell {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.profit-positive {
    color: #4caf50;
}

.profit-negative {
    color: #f44336;
}

.profit-neutral {
    color: rgba(255, 255, 255, 0.7);
}

/* Short position styling */
.short-position {
    color: #f44336 !important;
}

.item-quantity.short-position {
    color: #f44336;
}

.item-quantity.short-position i {
    color: #f44336;
}

.tax-amount {
    color: #ff9800;
    font-weight: 500;
}

.tax-zero {
    color: rgba(255, 255, 255, 0.5);
}

.action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* Edit functionality styles */
.edit-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ffd700;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
}

.edit-input:focus {
    outline: none;
    border-color: #ffed4e;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.edit-btn {
    margin-right: 0.5rem;
}

.save-btn {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

.save-btn:hover {
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.cancel-btn {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

.cancel-btn:hover {
    background: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

/* Editing state styles */
.trades-table tr.editing {
    background: rgba(255, 215, 0, 0.05);
}

.trades-table tr.editing:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* Responsive Design for Tracking */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .profit-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .trades-actions {
        flex-direction: column;
    }
    
    .trades-table {
        font-size: 0.9rem;
    }
    
    .trades-table th,
    .trades-table td {
        padding: 0.75rem 0.5rem;
    }

    .trade-filters .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .trade-filters .filter-item {
        min-width: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .trade-filters .filter-item .filter-label {
        justify-content: center;
    }

    .trade-filters .filter-item .filter-label .label-text {
        display: none;
    }

    .trade-filters .filter-item .filter-label i {
        font-size: 1rem;
    }

    .trade-filters .filter-actions {
        justify-content: flex-start;
    }
}

/* Data Management Section */
.data-management-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

.data-management-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.management-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.info-card i {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.info-card p {
    font-size: 0.9rem;
    color: #b8c5d6;
    line-height: 1.5;
}

.management-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.management-actions .btn-primary,
.management-actions .btn-secondary {
    min-width: 160px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .management-info {
        grid-template-columns: 1fr;
    }
    
    .management-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .management-actions .btn-primary,
    .management-actions .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
}

/* Google Drive Integration */
.google-drive-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.google-drive-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffd700;
}

.google-drive-section p {
    font-size: 0.9rem;
    color: #b8c5d6;
    margin-bottom: 1rem;
}

.drive-status {
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.status-indicator i {
    font-size: 0.75rem;
}

.status-indicator.connected i {
    color: #4caf50;
}

.status-indicator.disconnected i {
    color: #f44336;
}

.status-indicator.connecting i {
    color: #ff9800;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.drive-actions,
.drive-file-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.drive-actions .btn-primary,
.drive-actions .btn-secondary,
.drive-file-actions .btn-primary,
.drive-file-actions .btn-secondary {
    min-width: 160px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.drive-files {
    margin-top: 1rem;
}

.drive-files h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.8rem;
    color: #b8c5d6;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.file-action-btn.delete:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

@media (max-width: 768px) {
    .drive-actions,
    .drive-file-actions {
        flex-direction: column;
    }
    
    .drive-actions .btn-primary,
    .drive-actions .btn-secondary,
    .drive-file-actions .btn-primary,
    .drive-file-actions .btn-secondary {
        width: 100%;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-actions {
        align-self: flex-end;
    }
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.notification.success {
    background: linear-gradient(135deg, #4caf50, #45a049);
    border-left: 4px solid #2e7d32;
}

.notification.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border-left: 4px solid #c62828;
}

.notification.info {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border-left: 4px solid #1565c0;
}

/* Unrealized Gains Section */
.unrealized-gains-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

.unrealized-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.outstanding-items h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.outstanding-items h3 i {
    color: #ffd700;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.1);
}

.item-card::after {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.item-card:hover::after {
    opacity: 1;
    color: rgba(255, 215, 0, 0.7);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-header .item-sprite {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
}

.item-sprite-placeholder {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #8a9ba8;
    font-size: 16px;
}

/* Clickable sprite styling */
.clickable-sprite {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-sprite:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.item-sprite-placeholder.clickable-sprite:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness for unrealized gains item sprites */
@media (max-width: 768px) {
    .item-header {
        gap: 0.5rem;
    }
    
    .item-header .item-sprite,
    .item-sprite-placeholder {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .item-name {
        font-size: 1rem;
    }
    
    .item-card {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        min-height: 60px; /* Ensure minimum touch target size */
    }
    
    .item-card::after {
        right: 0.5rem;
        font-size: 0.7rem;
    }
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.item-details {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #b8c5d6;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.item-quantity i {
    color: #ffd700;
}

.item-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.item-value i {
    color: #4caf50;
}

.unrealized-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.9rem;
    color: #b8c5d6;
    font-weight: 500;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
}

.summary-value.positive {
    color: #4caf50;
}

.summary-value.negative {
    color: #f44336;
}

@media (max-width: 768px) {
    .unrealized-summary {
        grid-template-columns: 1fr;
    }
    
    .item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .item-details {
        flex-direction: column;
        gap: 0.5rem;
    }
} 

/* Profit Tracking Layout */
.profit-tracking-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

/* Add Trade Section */
.add-trade-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-trade-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-header h3 {
    color: #ffd700;
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #8a9ba8;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    flex-shrink: 0;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
}

.add-trade-form .form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.add-trade-form .form-group {
    margin: 0;
    flex: 1;
    min-width: 120px;
}

.add-trade-form .form-group:first-child {
    flex: 2;
    min-width: 200px;
}

.add-trade-form .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.add-trade-form .form-group input,
.add-trade-form .form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9rem;
}

.add-trade-form .form-group input:focus,
.add-trade-form .form-group select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.add-trade-form .form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
    flex-shrink: 0;
}

.add-trade-form .form-actions .btn-primary,
.add-trade-form .form-actions .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    height: fit-content;
}

@media (max-width: 768px) {
    .add-trade-form .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .add-trade-form .form-group {
        min-width: auto;
        flex: none;
        width: 100%;
    }
    
    .add-trade-form .form-group:first-child {
        flex: none;
        min-width: auto;
    }
    
    .add-trade-form .form-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .add-trade-form .form-actions .btn-primary,
    .add-trade-form .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    .form-header {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
    
    .form-header h3 {
        text-align: left;
        flex: 1;
    }
    
    .settings-btn {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .add-trade-form .form-row {
        gap: 1rem;
    }
    
    .add-trade-form .form-group input,
    .add-trade-form .form-group select {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .add-trade-form .form-actions .btn-primary,
    .add-trade-form .form-actions .btn-secondary {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .trade-type-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .trade-type-toggle .toggle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-header h3 {
        font-size: 0.85rem;
    }
    
    .settings-btn {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
}

/* Tracking Tabs */
.tracking-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.tracking-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-bottom: 3px solid transparent;
}

.tracking-tab-btn:hover {
    color: #f4e6d7;
    background: rgba(255, 255, 255, 0.1);
}

.tracking-tab-btn.active {
    color: #f4e6d7;
    border-bottom-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.tracking-tab-btn i {
    font-size: 1.2rem;
}

.tracking-tab-btn span {
    font-size: 0.8rem;
}

/* Tracking Content */
.tracking-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.tracking-panel {
    display: none;
    height: 100%;
    padding: 2rem;
    overflow-y: auto;
}

.tracking-panel.active {
    display: block;
}

/* Panel Headers */
.tracking-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tracking-panel .header-content h2 {
    color: #ffd700;
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tracking-panel .header-content p {
    color: #b8c5d6;
    margin: 0;
    font-size: 0.9rem;
}

.tracking-panel .header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Summary Panel */
#summary-panel .quick-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    width: 100%;
    justify-content: space-between;
}

#summary-panel .quick-stats .stat-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: help;
    transition: all 0.2s ease;
    min-width: 0;
}

#summary-panel .quick-stats .stat-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

#summary-panel .main-chart {
    flex: 1;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Unrealized Gains Panel */
#gains-panel .unrealized-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#gains-panel .summary-item {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#gains-panel .outstanding-items {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Trade History Panel */
#history-panel .trades-table-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    margin-bottom: 1rem;
}

#history-panel .trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#history-panel .trades-table th {
    background: rgba(0, 0, 0, 0.3);
    color: #ffd700;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#history-panel .trades-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#history-panel .trades-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Data Management Panel */
#data-panel .management-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#data-panel .google-drive-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#data-panel .google-drive-section h3 {
    color: #ffd700;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tracking-tabs {
        flex-wrap: wrap;
    }
    
    .tracking-tab-btn {
        min-width: 120px;
        padding: 0.75rem 0.25rem;
    }
    
    .tracking-tab-btn span {
        font-size: 0.7rem;
    }
    
    .tracking-panel {
        padding: 1rem;
    }
    
    .tracking-panel .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .tracking-panel .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    #summary-panel .quick-stats {
        flex-direction: column;
    }
    
    #gains-panel .unrealized-summary {
        flex-direction: column;
    }
    
    #data-panel .management-actions {
        flex-direction: column;
    }
} 

/* Compact Form Styles */
.trade-form.compact {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-form.compact .form-group {
    margin-bottom: 0.75rem;
}

.trade-form.compact .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.trade-form.compact .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trade-form.compact .btn-primary,
.trade-form.compact .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Compact Summary Styles */
.unrealized-summary.compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item .summary-label {
    font-size: 0.85rem;
    color: #b8c5d6;
}

.summary-item .summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #ffd700;
}

/* Compact Items List */
.outstanding-items.compact .items-list {
    max-height: 150px;
    overflow-y: auto;
}

.outstanding-items.compact .item-card {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.outstanding-items.compact .item-name {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.outstanding-items.compact .item-details {
    font-size: 0.8rem;
    gap: 0.5rem;
}





/* Trade History Panel Styles */
#history-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#history-panel .panel-header h3 {
    margin: 0;
    color: #ffd700;
    font-size: 1.3rem;
}

#history-panel .section-actions {
    display: flex;
    gap: 0.5rem;
}

/* Compact Table Styles */
.trades-table-container.compact {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-height: none;
    overflow: visible;
}

.trades-table.compact {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.trades-table.compact th,
.trades-table.compact td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trades-table.compact th {
    background: rgba(0, 0, 0, 0.2);
    color: #ffd700;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trades-table.compact tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.trades-table.compact td {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* Compact action buttons */
.btn-secondary.small {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-width: auto;
}

.btn-secondary.small i {
    font-size: 0.8rem;
}

/* Compact Management Actions */
.management-actions.compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.management-actions.compact .btn-primary,
.management-actions.compact .btn-secondary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    justify-content: center;
}

/* Compact Google Drive Section */
.google-drive-section.compact {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.google-drive-section.compact h5 {
    color: #ffffff;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.google-drive-section.compact p {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.google-drive-section.compact .drive-actions,
.google-drive-section.compact .drive-file-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.google-drive-section.compact .btn-primary,
.google-drive-section.compact .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    justify-content: center;
}

.google-drive-section.compact .files-list {
    max-height: 150px;
    overflow-y: auto;
}

.google-drive-section.compact .file-item {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
}

.google-drive-section.compact .file-name {
    font-size: 0.85rem;
}

.google-drive-section.compact .file-meta {
    font-size: 0.75rem;
}

.google-drive-section.compact h6 {
    color: #b8c5d6;
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive Design for New Layout */
@media (max-width: 1024px) {
    .profit-tracking-layout {
        height: auto;
        min-height: auto;
    }
    
    .main-chart-section {
        margin-bottom: 1rem;
    }
    
    .quick-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .chart-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-chart-section {
        padding: 1.5rem;
    }
    
    .chart-title h2 {
        font-size: 1.5rem;
    }
    
    .bottom-tab-panel {
        padding: 1rem;
    }
    
    .trade-form.compact .form-row {
        grid-template-columns: 1fr;
    }
    
    .trades-table.compact {
        font-size: 0.8rem;
    }
    
    .trades-table.compact th,
    .trades-table.compact td {
        padding: 0.4rem 0.5rem;
    }
    
    .bottom-tab-btn {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .bottom-tab-btn i {
        font-size: 1rem;
    }
    
    .bottom-tab-btn span {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .main-chart-section {
        padding: 1rem;
    }
    
    .chart-title h2 {
        font-size: 1.3rem;
    }
    
    .quick-stats .stat-card {
        padding: 0.75rem;
    }
    
    .main-chart {
        padding: 1rem;
    }
    
    .bottom-tab-content {
        max-height: 350px;
    }
}

/* Favorites Functionality Styles */

/* Favorite Button Styles */
.favorite-btn {
    background: transparent;
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.favorite-btn:hover {
    background: var(--surface-primary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05);
}

.favorite-btn.favorited {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.favorite-btn.favorited:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: scale(1.05);
}

.favorite-btn i {
    transition: all 0.3s ease;
}

.favorite-btn.favorited i {
    color: white;
}

/* Modal Header Actions */
.modal-actions {
    display: flex;
    align-items: center;
}

/* Inline Favorite Buttons in Search Results */
.item-favorite-btn {
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 0.5rem;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.item-favorite-btn:hover {
    background: var(--surface-primary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.item-favorite-btn.favorited {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.item-favorite-btn.favorited:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

/* Update item cell to accommodate favorite button */
.item-cell {
    position: relative;
    padding-right: 3rem;
}

/* Favorites Section Styles */
.favorites-section {
    background: var(--surface-primary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-primary);
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.favorites-header .header-content h2 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.favorites-header .header-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.favorites-actions {
    display: flex;
    gap: 0.75rem;
}

.favorites-filters {
    background: var(--surface-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-secondary);
}

.favorites-filters .filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    align-items: end;
}

.favorites-content {
    min-height: 300px;
}

.favorites-results {
    position: relative;
}

.no-favorites {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.no-favorites i {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-favorites h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-favorites p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Favorites Results Table */
.favorites-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.favorites-table th {
    background: var(--surface-primary);
    color: var(--accent-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.favorites-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-secondary);
    vertical-align: middle;
}

.favorites-table tr:hover {
    background: var(--surface-primary);
}

.favorites-item-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.favorites-item-sprite {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--surface-primary);
    border: 1px solid var(--border-secondary);
}

.favorites-item-info {
    flex: 1;
}

.favorites-item-name {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.favorites-item-name:hover {
    color: var(--accent-primary);
}

.favorites-date-added {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.favorites-actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.remove-favorite-btn {
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    padding: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.remove-favorite-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    color: #f44336;
}

/* Responsive Favorites Styles */
@media (max-width: 768px) {
    .favorites-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .favorites-filters .filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .favorites-table {
        font-size: 0.875rem;
    }
    
    .favorites-table th,
    .favorites-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .favorites-item-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .favorites-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .favorites-filters {
        padding: 1rem;
    }
    
    .favorites-table th,
    .favorites-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Trade Modal Styles */
.trade-modal {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.trade-modal .modal-header h2 {
    color: #ffd700;
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trade-modal .trade-form {
    background: none;
    border: none;
    padding: 0;
}

.trade-modal .form-group {
    margin-bottom: 1.5rem;
}

.trade-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.trade-modal .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-modal .btn-primary,
.trade-modal .btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .trade-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .trade-modal .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .trade-modal .form-actions {
        flex-direction: column;
    }
} 

/* Clickable Item Names */
.item-name.clickable {
    color: #4a9eff;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px dotted rgba(74, 158, 255, 0.5);
}

.item-name.clickable:hover {
    color: #66b3ff;
    border-bottom-color: #66b3ff;
    text-decoration: none;
}

.item-name.clickable:active {
    color: #3385d6;
}

/* Item Detail Modal */
#itemDetailModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

#itemDetailModal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

#itemDetailModal .modal-content {
    background: rgba(26, 26, 46, 0.95);
    border-radius: 16px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#itemDetailModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#itemDetailModal .header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#itemDetailModal .modal-item-sprite {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

#itemDetailModal .modal-header h2 {
    color: #ffd700;
    margin: 0;
    font-size: 1.5rem;
}

#itemDetailModal .modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#itemDetailModal .modal-close:hover {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

#itemDetailModal .modal-body {
    padding: 1.5rem;
}

#itemDetailModal .item-details-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

#itemDetailModal .item-details-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#itemDetailModal .item-details-table tr:last-child td {
    border-bottom: none;
}

#itemDetailModal .detail-label {
    color: #b8c5d6;
    font-weight: 500;
    width: 40%;
}

#itemDetailModal .detail-value {
    color: #ffffff;
    font-weight: 600;
}

#itemDetailModal .item-links h3 {
    color: #ffd700;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

#itemDetailModal .links-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#itemDetailModal .external-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #4a9eff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

#itemDetailModal .external-link:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: #4a9eff;
    color: #66b3ff;
    transform: translateY(-1px);
}

#itemDetailModal .external-link i {
    font-size: 1.1rem;
}

#itemDetailModal .modal-item-sprite.custom-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 24px;
    color: #8a9ba8;
}

#itemDetailModal .custom-item-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

#itemDetailModal .notice-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #ffc107;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-size: 12px;
}

#itemDetailModal .notice-content h3 {
    margin: 0 0 0.5rem 0;
    color: #ffc107;
    font-size: 1.1rem;
}

#itemDetailModal .notice-content p {
    margin: 0;
    color: #b8c5d6;
    line-height: 1.5;
}

/* Item Unrealized Gains Section */
.item-unrealized-gains-section {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-unrealized-gains-section h3 {
    margin: 0 0 0.5rem 0;
    color: #ffd700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-holdings-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-holding-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.item-holding-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.item-holding-label {
    font-size: 0.8rem;
    color: #8a9ba8;
}

.item-holding-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.item-holding-value.positive {
    color: #4ade80;
}

.item-holding-value.negative {
    color: #f87171;
}

.item-holding-details {
    text-align: right;
    font-size: 0.75rem;
    color: #8a9ba8;
}

/* Item Add Trade Section */
.item-add-trade-section {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-add-trade-section h3 {
    margin: 0 0 0.75rem 0;
    color: #ffd700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-add-trade-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-add-trade-form .form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.item-add-trade-form .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-add-trade-form .form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.item-add-trade-form .form-group input {
    padding: 0.625rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.item-add-trade-form .form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface-primary);
    box-shadow: 0 0 0 3px var(--accent-primary);
}

.item-add-trade-form .form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.item-add-trade-form .form-actions .btn-primary,
.item-add-trade-form .form-actions .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.item-add-trade-form .form-actions .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f4e6d7;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.item-add-trade-form .form-actions .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.item-add-trade-form .form-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-add-trade-form .form-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .item-add-trade-form .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .item-add-trade-form .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .item-add-trade-form .form-actions .btn-primary,
    .item-add-trade-form .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Settings Modal Styles */
.settings-modal {
    max-width: 600px;
    max-height: 80vh;
}

.settings-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3 {
    color: #ffd700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-group {
    margin-bottom: 1rem;
}

.setting-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-group input[type="number"],
.setting-group input[type="text"][data-number="true"],
.setting-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9rem;
}

.setting-group input[type="number"]:focus,
.setting-group input[type="text"][data-number="true"]:focus,
.setting-group select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: inline-block;
    box-sizing: border-box;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2d1810;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: rgba(255, 255, 255, 0.5);
}

.shortcuts-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.shortcuts-info p {
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.shortcuts-info strong {
    color: #ffd700;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .settings-modal {
        margin: 5% auto;
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
        justify-content: center;
    }
} 

@media (max-width: 768px) {
    .item-add-trade-form .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .item-add-trade-form .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .item-add-trade-form .form-actions .btn-primary,
    .item-add-trade-form .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    #itemDetailModal .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    #itemDetailModal .modal-header {
        padding: 1rem;
    }
    
    #itemDetailModal .modal-body {
        padding: 1rem;
    }
    
    #itemDetailModal .header-content {
        gap: 0.75rem;
    }
    
    #itemDetailModal .modal-header h2 {
        font-size: 1.3rem;
    }
}

.item-add-trade-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Trade History Pagination */
#tradePagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

#tradePagination .pagination-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tradePagination .pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

#tradePagination .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#tradePagination .pagination-info {
    font-weight: 500;
    color: #b8c5d6;
}

/* Footer Styles */
.footer {
    background: var(--surface-primary);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-primary);
    padding: 1.5rem 0;
    margin-top: 3rem;
    transition: all 0.3s ease;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--surface-primary);
    border: 1px solid var(--border-primary);
}

.footer-link:hover {
    color: var(--accent-primary);
    background: var(--surface-primary);
    border-color: var(--accent-primary);
    transition: all 0.3s ease;
}

.footer-link i {
    font-size: 1rem;
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-text p {
    margin: 0;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-link {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer-link {
        justify-content: center;
    }
}

/* Theme Toggle Styles */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.theme-toggle-label {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.theme-options {
    display: flex;
    gap: 8px;
}

.theme-square {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    overflow: hidden;
}

.theme-square::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.theme-square:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-square.active {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* RS3 Brown Theme Square */
.theme-square.rs3-brown {
    background: linear-gradient(135deg, #7a3f08 0%, #b55e0c 50%, #f7861b 100%);
}

.theme-square.rs3-brown::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(247, 134, 27, 0.2) 100%);
}

.theme-square.rs3-brown:hover::before {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0%, rgba(247, 134, 27, 0.3) 100%);
}

/* Original Blue/Gold Theme Square */
.theme-square.blue-gold {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
}

.theme-square.blue-gold::before {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.3) 0%, rgba(52, 152, 219, 0.2) 100%);
}

.theme-square.blue-gold:hover::before {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.4) 0%, rgba(52, 152, 219, 0.3) 100%);
}

.theme-square.blue-gold::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
}

@media (max-width: 768px) {
    .theme-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        justify-content: center;
    }
    
    .footer-links {
        order: 1;
        justify-content: center;
        width: 100%;
    }
    
    .footer-text {
        order: 2;
        text-align: center;
        width: 100%;
    }
}

/* Touch feedback for mobile devices */
.suggestion-item.touch-active {
    background: rgba(255, 215, 0, 0.15);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

.search-btn.touch-active {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(0.95);
    transition: all 0.1s ease;
}

.suggestion-item.touch-active {
    background: rgba(255, 215, 0, 0.15);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Mobile-specific button improvements */
.mobile-device .search-btn {
    /* Ensure proper touch behavior on mobile */
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* Minimum touch target size */
    padding: 0.75rem 1.5rem;
    /* Ensure proper button behavior on mobile */
    font-size: 1rem;
    font-weight: 500;
}

/* Mobile-specific input improvements */
.mobile-device .search-field input {
    /* Ensure proper input behavior on mobile */
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 5px;
    /* Prevent zoom on iOS */
    -webkit-text-size-adjust: 100%;
    /* Ensure proper input behavior on mobile */
    min-height: 44px;
    padding: 0.75rem;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .suggestion-item {
        min-height: 44px; /* Minimum touch target size */
        padding: 0.75rem 1rem;
        /* Ensure touch targets are easily tappable */
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        /* Ensure proper touch behavior */
        -webkit-tap-highlight-color: transparent;
        /* Ensure proper touch feedback */
        transition: all 0.1s ease;
    }
    
    .search-suggestions {
        max-height: 200px; /* Increase height on mobile */
        z-index: 1001; /* Ensure it's above other elements */
        /* Ensure suggestions are visible on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
}

/* Mobile device specific styles */
.mobile-device .search-suggestions {
    /* Ensure suggestions are visible on mobile devices */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    /* Ensure suggestions are above virtual keyboard */
    transform: translateZ(0); /* Force hardware acceleration */
    /* Ensure suggestions are visible on mobile */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* Ensure suggestions are visible on mobile */
    border-radius: 0 0 8px 8px;
}

.mobile-device .search-input-container {
    /* Ensure proper positioning on mobile */
    position: relative;
    z-index: 1002;
    /* Ensure proper container behavior on mobile */
    width: 100%;
}

.mobile-device .search-field {
    /* Ensure proper positioning on mobile */
    position: relative;
    z-index: 1002;
    /* Ensure proper field behavior on mobile */
    width: 100%;
}

.mobile-device .search-field input {
    /* Ensure proper input behavior on mobile */
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 5px;
    /* Prevent zoom on iOS */
    -webkit-text-size-adjust: 100%;
    /* Ensure proper input behavior on mobile */
    min-height: 44px;
    padding: 0.75rem;
    width: 100%;
}

@media (max-width: 480px) {
    .suggestion-item {
        min-height: 48px; /* Even larger touch targets on small screens */
        padding: 0.875rem 1rem;
        /* Ensure touch targets are easily tappable */
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        /* Ensure proper touch behavior */
        -webkit-tap-highlight-color: transparent;
        /* Ensure proper touch feedback */
        transition: all 0.1s ease;
    }
    
    .search-suggestions {
        max-height: 180px;
        border-radius: 0 0 6px 6px;
        /* Ensure suggestions are visible on very small screens */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1001;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .suggestion-text {
        font-size: 0.95rem; /* Slightly larger text on mobile */
    }
    
    .suggestion-price {
        font-size: 0.85rem;
    }
    
    .suggestion-sprite {
        width: 20px;
        height: 20px;
    }
    
    /* Ensure search field is properly sized on mobile */
    .search-field input {
        font-size: 16px;
        padding: 0.75rem;
        min-height: 44px;
    }
}

