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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

/* Disable Chrome Tap to Search and Mobile Web Behaviors */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Disable zoom and other mobile web behaviors */
html, body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Allow text selection only in input fields */
input, textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

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

@keyframes scanPulse {
    0% { 
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
        transform: scale(1);
        border-color: #00ff88;
    }
    50% { 
        box-shadow: 0 0 50px rgba(0, 255, 136, 0.8);
        transform: scale(1.02);
        border-color: #00ffaa;
    }
    100% { 
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
        transform: scale(1);
        border-color: #00ff88;
    }
}

@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes cornerGlow {
    0% {
        box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
        border-color: #00ff88;
    }
    100% {
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.9);
        border-color: #00ffaa;
    }
}

/* Screen Management */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login Screen */
.login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.login-form h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #2196F3;
}

.subtitle {
    color: #666;
    margin-bottom: 32px;
}

/* Login screen specific input-group (vertical layout) */
#login-form .input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

#login-form .input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#login-form .input-group input:focus {
    outline: none;
    border-color: #2196F3;
}

/* Login button styling */
#login-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #2196F3;
    color: white;
    transition: background-color 0.2s;
    white-space: nowrap;
}

#login-btn:hover:not(:disabled) {
    background: #1976D2;
}

#login-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Login error message styling */
#login-error {
    margin-top: 12px;
    text-align: center;
    color: #dc3545;
    font-size: 0.9rem;
    padding: 12px;
    background: #f8d7da;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* App Header */
.app-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-info h1 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.status-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.status-badge.online {
    background: #d4edda;
    color: #155724;
}

.status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

/* Status Stats */
.status-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    font-size: 0.75rem;
    color: #6c757d;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    white-space: nowrap;
    cursor: help;
}

.stat-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* Responsive stats */
@media (max-width: 768px) {
    .status-stats {
        gap: 8px;
        font-size: 0.7rem;
    }
    
    .stat-item {
        padding: 1px 4px;
    }
}

@media (max-width: 480px) {
    .status-badges {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .status-stats {
        margin-left: 0;
        gap: 6px;
    }
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #666;
}

.sync-spinner {
    animation: spin 1s linear infinite;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    padding: 8px 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
}

.nav-item.active {
    color: #2196F3;
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #dc3545;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px; /* Space for bottom nav */
}

.tab-content {
    display: none;
}

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

/* Mode Switch */
.mode-switch {
    display: flex;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.mode-btn.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mode Content */
.mode-content {
    display: none;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

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

/* Scanner Mode */
.scanner-inputs {
    padding: 20px 0;
}

.scanner-instructions {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.scanner-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.scanner-instructions h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.scanner-instructions p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.scanner-status {
    margin-top: 10px;
    text-align: center;
}

#scanner-status-text {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 500;
    padding: 4px 12px;
    background: #d4edda;
    border-radius: 20px;
    display: inline-block;
}

#scanner-input {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 1px;
}

#scanner-input:focus {
    border-color: #2196F3;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

#scanner-input.scanning {
    border-color: #28a745;
    background: #d4edda;
    animation: pulse 1.5s ease-in-out infinite;
}

.scanner-help {
    margin-top: 8px;
    text-align: center;
}

.scanner-help small {
    color: #6c757d;
    font-style: italic;
}

/* Scanner Product Selection - Now uses existing search-results styling */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Barcode Mode */
.camera-section {
    text-align: center;
}

.camera-controls {
    display: flex;
    gap: 20px;
    margin-top: 32px;
    justify-content: center;
    padding: 0 24px;
    flex-wrap: wrap;
}

/* Barcode Loading Indicator */
.barcode-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 16px;
    color: #495057;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.barcode-loading-indicator .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.barcode-loading-indicator p {
    color: #495057;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.camera-controls button {
    flex: 1;
    max-width: 180px;
    min-width: 140px;
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.camera-controls button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.camera-controls button:hover::before {
    left: 100%;
}

.camera-controls button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.camera-controls button:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.camera-preview {
    width: 100%;
    height: 400px;
    background: #f8f9fa;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.scan-info {
    text-align: center;
    color: white;
    padding: 20px;
}

.scan-info h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.scan-info p {
    margin: 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

.scan-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.scan-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.95);
    color: white;
    padding: 24px 32px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.3);
}

.scan-error h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.scan-error p {
    margin: 5px 0;
    font-size: 14px;
}

.troubleshooting {
    margin: 15px 0;
    text-align: left;
}

.troubleshooting details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
}

.troubleshooting summary {
    font-weight: bold;
    margin-bottom: 10px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.troubleshooting summary::-webkit-details-marker {
    display: none;
}

.troubleshooting summary::before {
    content: '▶';
    transition: transform 0.2s;
}

.troubleshooting details[open] summary::before {
    transform: rotate(90deg);
}

.tips-content {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.tips-content h5 {
    margin: 10px 0 5px 0;
    font-size: 14px;
    color: #fff;
}

.tips-content ul {
    margin: 5px 0 10px 20px;
    padding: 0;
}

.tips-content li {
    margin: 3px 0;
}

.camera-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.critical-error {
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

.critical-error h5 {
    color: #dc3545;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.critical-error p {
    margin: 5px 0;
    font-size: 14px;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* Scanning overlay styles */
.scanning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.scanning-frame {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border: 2px solid rgba(0, 255, 0, 0.8);
    border-radius: 8px;
}

.scanning-corners {
    position: relative;
    width: 100%;
    height: 100%;
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #00ff00;
}

.corner.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.corner.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
}

.corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
}

.corner.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.scanning-text {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.scanning-text p {
    margin: 2px 0;
    font-size: 12px;
}

.torch-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.torch-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

.scan-again-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #007bff;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.scan-again-btn:hover {
    background: #0056b3;
}

/* ZXing-js canvas styling */
#camera-preview canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

#camera-preview video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.scan-target {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scan-target p {
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    margin: 20px 0 0 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s ease-in-out infinite;
}

.scan-frame {
    width: 280px;
    height: 180px;
    border: 4px solid #00ff88;
    border-radius: 20px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    animation: scanPulse 2s ease-in-out infinite;
    background: rgba(0, 255, 136, 0.05);
    backdrop-filter: blur(5px);
}

.scan-frame::before,
.scan-frame::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 5px solid #00ff88;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
}

.scan-frame::before {
    top: -5px;
    left: -5px;
    border-right: none;
    border-bottom: none;
    animation: cornerGlow 1.5s ease-in-out infinite alternate;
}

.scan-frame::after {
    bottom: -5px;
    right: -5px;
    border-left: none;
    border-top: none;
    animation: cornerGlow 1.5s ease-in-out infinite alternate 0.5s;
}

/* Scanning line animation */
.scan-frame::before {
    position: relative;
}

.scan-frame::before::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff88, transparent);
    animation: scanLine 2s linear infinite;
}

/* Manual Mode */
.manual-inputs {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #333;
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.search-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input-container input {
    flex: 1;
}

.search-input-container .btn-icon {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.search-input-container .btn-icon:hover {
    border-color: #2196F3;
    color: #2196F3;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #2196F3;
}

.divider {
    text-align: center;
    color: #666;
    font-weight: 500;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: -1;
}

.divider {
    background: #f5f5f5;
    padding: 0 16px;
}

/* Search Results */
.search-results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 8px;
    /* Remove max-height and overflow to let parent handle scrolling */
}

.search-result {
    padding: 16px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result:hover {
    background: #f8f9fa;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.search-result-barcode {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}

.search-result-price {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
}

/* Search Loading Indicator */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

.search-loading i {
    color: #2196F3;
}

/* Search Results Header */
.search-results-header {
    background: #e3f2fd;
    border-bottom: 1px solid #bbdefb;
    padding: 8px 16px;
}

.server-search-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1976d2;
    font-size: 0.8rem;
    font-weight: 500;
}

.server-search-indicator i {
    color: #1976d2;
}

/* Search Results Actions */
.search-results-actions {
    padding: 20px 16px 16px 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    text-align: center;
}

.search-results-actions .btn-secondary {
    padding: 10px 24px;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* No barcode styling */
.product-barcode.no-barcode {
    color: #6c757d;
    font-style: italic;
}

/* Cancel option in search results */
.search-result.cancel-option {
    border: 1px solid #dc3545;
    background: #f8d7da;
}

.search-result.cancel-option:hover {
    background: #f5c6cb;
    border-color: #c82333;
}

/* Enhanced Batch Loading Indicator */
.batch-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.batch-loading-indicator.hidden {
    display: none;
}

.batch-loading-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    min-width: 350px;
    max-width: 450px;
    animation: slideUp 0.4s ease-out;
}

.loading-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.loading-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.loading-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.progress-container {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
}

.loading-details {
    margin-bottom: 24px;
}

.loading-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.stat-item i {
    color: #667eea;
    font-size: 0.8rem;
}

.loading-status {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.loading-animation {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: pulseDots 1.4s infinite ease-in-out;
}

.pulse-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.pulse-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.pulse-dot:nth-child(3) {
    animation-delay: 0s;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulseDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .batch-loading-content {
        min-width: 300px;
        max-width: 350px;
        padding: 24px;
    }
    
    .loading-title {
        font-size: 1.2rem;
    }
    
    .loading-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.product-header {
    margin-bottom: 16px;
}

.product-header h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.barcode {
    font-size: 0.9rem;
    color: #666;
    font-family: monospace;
}

.product-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.detail-row .label {
    font-weight: 500;
    color: #666;
}

/* Quantity Widget */
.quantity-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.qty-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.2s;
}

.qty-btn.primary {
    background: #2196F3;
    color: white;
}

.qty-btn.primary:hover {
    background: #1976D2;
    transform: scale(1.05);
}

.qty-btn.primary:active {
    transform: scale(0.95);
}

.qty-btn.secondary {
    background: #dc3545;
    color: white;
}

.qty-btn.secondary:hover {
    background: #c82333;
    transform: scale(1.05);
}

.qty-btn.secondary:active {
    transform: scale(0.95);
}

.qty-btn .label {
    font-size: 0.7rem;
    margin-top: 2px;
}

.qty-display {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    min-width: 60px;
    text-align: center;
}

/* Reason Section */
.reason-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.reason-section h4 {
    margin-bottom: 12px;
    color: #333;
}

.reason-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.reason-tag {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.reason-tag:hover,
.reason-tag.selected {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.reason-section textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

/* Comment Section */
.comment-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comment-section h4 {
    margin-bottom: 12px;
    color: #333;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.comment-section textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.comment-section textarea:invalid {
    border-color: #dc3545;
}

/* Subtract Reason Section */
.subtract-reason-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #fed7d7;
}

.subtract-reason-section h4 {
    margin-bottom: 12px;
    color: #c53030;
}

.subtract-reason-section textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.subtract-reason-section textarea:invalid {
    border-color: #c53030;
}

/* Preview Section */
.preview-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 8px;
}

.preview-line {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1976D2;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.product-actions .btn-primary,
.product-actions .btn-secondary {
    flex: 1;
}

/* Button Loading States */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Transactions */
.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.transactions-header h2 {
    font-size: 1.3rem;
}

.transaction-filters {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.transaction-product {
    font-weight: 500;
    margin-bottom: 4px;
}

.transaction-barcode {
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
}

.transaction-qty {
    font-size: 1.1rem;
    font-weight: 600;
}

.transaction-qty.positive {
    color: #28a745;
}

.transaction-qty.negative {
    color: #dc3545;
}

.transaction-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.transaction-reason {
    font-size: 0.8rem;
    color: #666;
}

.transaction-comment {
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.transaction-comment strong {
    color: #333;
}

.transaction-delete-reason {
    margin-bottom: 8px;
    padding: 8px;
    background: #fff5f5;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.transaction-delete-reason strong {
    color: #c53030;
}

.transaction-time {
    font-size: 0.8rem;
    color: #999;
}

.transaction-actions {
    margin-top: 8px;
}

.undo-btn {
    padding: 4px 8px;
    border: 1px solid #dc3545;
    border-radius: 4px;
    background: white;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.undo-btn:hover {
    background: #dc3545;
    color: white;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: #333;
}

.barcode-error {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.5;
}

.barcode-error strong {
    color: #d39e00;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 1.05em;
}

/* Logout Tab */
.logout-content {
    text-align: center;
    padding: 40px 20px;
}

.logout-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.logout-content h2 {
    margin-bottom: 16px;
    color: #333;
}

.logout-content p {
    margin-bottom: 12px;
    color: #666;
}

.logout-warning {
    color: #dc3545;
    font-weight: 500;
}

.logout-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.logout-actions .btn-danger,
.logout-actions .btn-secondary {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

/* Logout loading state */
.logout-actions .btn-danger:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #6c757d, #5a6268);
    border-color: #6c757d;
}

.logout-actions .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: auto;
}

/* Ensure product cards remain visible when modal is open */
.modal-open .product-card {
    z-index: 1000 !important;
    position: relative;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #2196F3;
    position: relative;
    z-index: 10000;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-body {
    padding: 20px;
}

/* Quantity Keypad */
.qty-keypad {
    text-align: center;
}

.qty-display input {
    width: 100%;
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 20px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.key {
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.2s;
}

.key:hover {
    background: #f8f9fa;
}

.key:active {
    transform: scale(0.95);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
    width: 90%;
    max-width: 320px;
}

.toast {
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    animation: slideInDown 0.25s ease-out;
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    backdrop-filter: blur(8px);
    border: none;
    opacity: 0.9;
    line-height: 1.3;
}

.toast.success {
    background: rgba(40, 167, 69, 0.85);
}

.toast.error {
    background: rgba(220, 53, 69, 0.85);
}

.toast.warning {
    background: rgba(255, 193, 7, 0.85);
    color: #333;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 0.9;
    }
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .toast-container {
        top: 50px;
        left: 50%;
        transform: translateX(-50%);
        width: 85%;
        max-width: 280px;
    }
    
    .toast {
        padding: 5px 10px;
        font-size: 12px;
        border-radius: 6px;
        margin-bottom: 4px;
        opacity: 0.9;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .product-card {
        padding: 16px;
    }
    
    .quantity-widget {
        gap: 12px;
    }
    
    .qty-btn {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .qty-display {
        font-size: 1.5rem;
    }
}

/* Long press detection */
.long-press {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ===== DataTables Styling for PWA ===== */

/* Transactions Header */
.transactions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 16px 0 16px;
}

.transactions-header h2 {
    margin: 0;
}

/* Table Container */
.transactions-table-container {
    margin: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: visible; /* Let DataTables handle overflow */
}

/* DataTables scroll container */
.transactions-table-container .dataTables_wrapper .dataTables_scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.transactions-table-container .dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* DataTables Wrapper */
.dataTables_wrapper {
    padding: 12px;
    font-size: 14px;
}

/* DataTables Controls */
.dataTables_length,
.dataTables_filter {
    padding: 8px 0;
}

.dataTables_length label,
.dataTables_filter label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.dataTables_length select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    margin: 0 6px;
    font-size: 13px;
}

.dataTables_filter input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    margin-left: 8px;
    width: 180px;
}

/* Table Styling */
#my-transactions-table {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto; /* Let browser calculate optimal widths */
}

#my-transactions-table thead th {
    background: #2196F3;
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #1976D2;
    white-space: nowrap;
}

#my-transactions-table tbody td {
    padding: 10px 10px;
    border-bottom: 1px solid #eee;
}

#my-transactions-table tbody tr:hover {
    background: #f8f9fa;
}

/* Center align quantity column */
#my-transactions-table .text-center {
    text-align: center;
}

/* Multiple Products Selection */
.multiple-products-selection {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.selection-header {
    text-align: center;
    margin-bottom: 20px;
}

.selection-header h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.selection-header p {
    color: #666;
    margin: 4px 0;
}

.products-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.product-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.product-option:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.product-details {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: #666;
}

.product-price {
    color: #28a745;
    font-weight: 600;
}

.product-stock {
    color: #6c757d;
}

.select-product {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.selection-actions {
    text-align: center;
}

.selection-actions .btn-secondary {
    padding: 10px 24px;
}

/* Footer Search Boxes */
#my-transactions-table tfoot th {
    padding: 8px 4px;
    background: #E3F2FD;
    border-top: 2px solid #2196F3;
}

#my-transactions-table tfoot input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

#my-transactions-table tfoot input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* Quantity Badge */
.qty-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

.qty-badge.positive {
    background: #E8F5E9;
    color: #2E7D32;
}

.qty-badge.negative {
    background: #FFEBEE;
    color: #C62828;
}

/* Info and Pagination */
.dataTables_info {
    padding: 12px 0;
    font-size: 13px;
    color: #666;
}

.dataTables_paginate {
    padding: 12px 0;
    text-align: center;
}

.dataTables_paginate .paginate_button {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #E3F2FD;
    border-color: #2196F3;
    color: #2196F3;
}

.dataTables_paginate .paginate_button.current {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
    font-weight: 600;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Responsive Adjustments for Different Screen Sizes */

/* Desktop (1024px+) - Full width, all columns visible */
@media (min-width: 1024px) {
    .transactions-table-container {
        margin: 20px;
    }
    
    #my-transactions-table {
        font-size: 14px;
        min-width: auto;
    }
    
    .dataTables_wrapper {
        padding: 16px;
    }
}

/* Tablet (768px - 1023px) - Moderate adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .transactions-table-container {
        margin: 16px;
    }
    
    #my-transactions-table {
        font-size: 13px;
        min-width: 700px;
    }
    
    #my-transactions-table thead th,
    #my-transactions-table tbody td {
        padding: 10px 8px;
    }
}

/* Mobile (< 768px) - Compact view with horizontal scroll */
@media (max-width: 767px) {
    .transactions-table-container {
        margin: 12px;
        position: relative;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .dataTables_filter input {
        width: 120px;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .dataTables_length select {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    #my-transactions-table {
        font-size: 12px;
        white-space: nowrap; /* Prevent text wrapping - forces horizontal scroll */
    }
    
    #my-transactions-table thead th,
    #my-transactions-table tbody td {
        padding: 8px 6px;
        white-space: nowrap; /* Keep content in one line */
    }
    
    #my-transactions-table tfoot input {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 6px 8px;
        font-size: 12px;
        margin: 0 1px;
    }
    
    /* Visual hint for horizontal scrolling */
    .dataTables_wrapper::after {
        content: '→';
        position: fixed;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: #2196F3;
        font-size: 24px;
        opacity: 0.5;
        pointer-events: none;
        animation: slideHint 2s ease-in-out infinite;
    }
    
    @keyframes slideHint {
        0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
        50% { opacity: 0.7; transform: translateY(-50%) translateX(5px); }
    }
    
    /* Compact info text */
    .dataTables_info {
        font-size: 11px;
    }
    
    /* Stack length and filter on mobile */
    .dataTables_length,
    .dataTables_filter {
        display: block;
        text-align: left;
        margin-bottom: 8px;
    }
}

/* Extra small mobile (< 375px) - Very compact */
@media (max-width: 374px) {
    #my-transactions-table {
        font-size: 11px;
    }
    
    #my-transactions-table thead th,
    #my-transactions-table tbody td,
    #my-transactions-table tfoot th {
        padding: 6px 4px;
    }
    
    .dataTables_wrapper {
        padding: 8px;
    }
}