/* Base Styles - Updated 2025-01-26 for mobile spacing fix */
:root {
    --primary: #2d46b9;
    --secondary: #6c4bd1;
    --dark: #1a1a2e;
    --light: #f1f1f1;
    --success: #4caf50;
    --error: #f44336;
    --gray: #888;
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-green: #00ff00;
    --neon-purple: #9d00ff;
    --neon-yellow: #ffff00;
    --icon-bg: #5e17eb;
    --spotify-green: #1DB954;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    color-scheme: light dark;
    -webkit-color-scheme: light dark;
}

body {
    font-family: 'Roboto', sans-serif;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    background: url('../img/request.jpg') no-repeat center center fixed;
    background-size: cover;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    margin-top: 30px;
}

/* Event Header */
.event-header {
    background: linear-gradient(145deg,
            var(--primary),
            var(--secondary),
            var(--primary),
            var(--secondary));
    background-size: 400% 400%;
    padding: 15px 5px 5px 5px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: gradientAnimation 15s ease infinite;
    border-radius: 20px 20px 0 0;
}

/* Event Header Content Layout */
.event-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.event-info {
    flex: 1;
    text-align: left;
}

/* QR Code Icon and Share Container */
.qr-share-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.qr-code-icon {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: white;
}

.qr-code-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qr-code-icon i {
    font-size: 20px;
}

.share-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: lowercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Define the gradient animation */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmerEffect {
    0% {
        transform: rotate(45deg) translateX(-15%);
    }
    100% {
        transform: rotate(45deg) translateX(15%);
    }
}

.event-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    position: relative;
    text-align: left;
}

.event-date {
    font-size: 16px;
    opacity: 0.8;
    position: relative;
}


.spotify-logo {
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    opacity: 0.8;
}

.spotify-logo .fa-spotify {
    color: var(--spotify-green);
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding: 30px 30px 15px 30px;
}

/* Form Styles */
.form-group {
    margin-bottom: 8px;
    position: relative;
}

/* Add extra top margin to the first form group for better spacing */
.form-group:first-child,
.form-group.search-input {
    margin-top: 18px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 18px;
    position: relative;
    z-index: 1;
}

/* Input Group Styles */
.input-group {
    display: flex;
    box-shadow: none;
    border-radius: 12px;
    position: relative;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Remove overflow: hidden to allow dropdown to be visible */
    overflow: visible;
}

.input-group-text {
    background: var(--icon-bg);
    color: white;
    border: none;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    border-radius: 10px 0 0 10px; /* Match parent's border-radius for left side */
    position: relative;
    z-index: 1; /* Lower z-index to ensure it doesn't overlap the dropdown */
    margin-right: 0; /* Remove negative margin that might cause issues */
}

.input-group-text i {
    font-size: 1.4rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-control {
    width: 100%;
    background: rgba(30, 30, 50, 0.6);
    border: none;
    border-radius: 0 12px 12px 0; /* Keep right side rounded */
    padding: 18px;
    color: rgba(255, 255, 255, 1);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    font-size: 18px;
    flex: 1;
    padding-right: 35px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1; /* Lower z-index to ensure it doesn't overlap the dropdown */
}

.form-control:focus {
    outline: none;
    background-color: rgba(30, 30, 50, 0.6);
    box-shadow: none;
    border-radius: 0 12px 12px 0; /* Maintain border radius on focus */
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Song-Artist Row Layout */
.song-artist-row {
    display: flex;
    gap: 10px;
}

.song-input,
.artist-input {
    flex: 1;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 18px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 18px;
    position: relative;
    overflow: visible;
    background-clip: padding-box;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.submit-btn i {
    font-size: 22px;
}

/* Message Styles */
.message {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 16px;
}

.message.error {
    background-color: transparent;
    border: 1px solid var(--error);
}

.message.success {
    background-color: rgba(76, 175, 80, 0.2);
    border-left: 3px solid var(--success);
}

/* Code Input Styles */
.code-form {
    padding: 40px;
    text-align: center;
}

.code-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.code-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    color: white;
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    text-transform: uppercase;
}

.code-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: none;
}

/* Recent request area styles have been removed */

/* Success Overlay - Matched with embed styles */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Background is a gradient with 3 color stops at 95% opacity */
    background: linear-gradient(135deg,
        rgba(45, 10, 108, 0.95) 0%,    /* Dark purple at 95% opacity */
        rgba(87, 39, 163, 0.95) 50%,   /* Medium purple at 95% opacity */
        rgba(123, 43, 204, 0.95) 100%  /* Lighter purple at 95% opacity */
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    opacity: 0; /* Start with 0 opacity for fade-in */
    
    /* Multiple transition declarations for maximum browser compatibility */
    -webkit-transition: opacity 0.5s ease !important;
    -moz-transition: opacity 0.5s ease !important;
    -o-transition: opacity 0.5s ease !important;
    transition: opacity 0.5s ease !important;
    
    /* Separate animation property */
    -webkit-animation: fadeIn 0.5s ease forwards;
    animation: fadeIn 0.5s ease forwards;
}

/* Add specific style for closing state with higher specificity */
.success-overlay.closing {
    animation: tvTurnOff 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
    -webkit-animation: tvTurnOff 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@keyframes tvTurnOff {
    0% {
        clip-path: inset(0% 0% 0% 0%);
        opacity: 1;
    }
    100% {
        clip-path: inset(50% 0% 50% 0%);
        opacity: 0;
    }
}

@-webkit-keyframes tvTurnOff {
    0% {
        -webkit-clip-path: inset(0% 0% 0% 0%);
        opacity: 1;
    }
    100% {
        -webkit-clip-path: inset(50% 0% 50% 0%);
        opacity: 0;
    }
}

/* Confetti and Animation Elements */
.confetti-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    opacity: 0;
    animation: confetti-fall 2s ease-in-out infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    25% {
        transform: scale(1.25);
        opacity: 1;
    }
    75% {
        transform: scale(1.75);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

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

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

.success-icon-container {
    position: relative;
    width: 120px; /* Increased size from 80px to 120px */
    height: 120px; /* Increased size from 80px to 120px */
    margin: 0 auto 60px; /* Increased bottom margin to move it higher away from text */
}

/* Add styles for the close hint */
.close-hint {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 10px;
    animation: pulse 2s infinite;
}

.success-icon {
    position: absolute; /* Match embed's absolute positioning */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white; /* Changed to white background like embed */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem; /* Increased font size from 2rem to 3rem */
    color: var(--primary); /* Changed color to match embed */
    animation: vinylSpin 2s linear infinite; /* Vinyl record spinning animation */
    z-index: 2;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); /* Simplified shadow */
    
}



.success-icon i {
    font-size: 3rem; /* Increased font size to match container size */
    position: relative;
    z-index: 3;
}

/* Replaced rings with embed-style rings - Using original color for light mode */
.ring {
    position: absolute;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 0 3px white;
    /* Remove base opacity to let animation control it */
}

.ring1 {
    top: 0px; /* Start behind the icon */
    left: 0px; /* Start behind the icon */
    right: 0px; /* Start behind the icon */
    bottom: 0px; /* Start behind the icon */
    animation: ripple 1.5s linear infinite !important; /* 1.5s duration for slower scaling */
    /* Use original color for light mode */
    border: none !important;
    box-shadow: 0 0 0 3px white !important;
    opacity: 1; /* Set initial opacity */
    animation-fill-mode: both !important; /* Ensure animation states are maintained */
}

.ring2 {
    top: 0px; /* Start behind the icon, same as ring1 */
    left: 0px; /* Start behind the icon, same as ring1 */
    right: 0px; /* Start behind the icon, same as ring1 */
    bottom: 0px; /* Start behind the icon, same as ring1 */
    animation: ripple 1.5s linear infinite 0.75s !important; /* 0.75s delay for even timing */
    /* Use original color for light mode */
    border: none !important;
    box-shadow: 0 0 0 3px white !important;
    opacity: 1; /* Set initial opacity */
    animation-fill-mode: both !important; /* Ensure animation states are maintained */
}

.success-song-info {
    color: white;
    text-align: center;
    margin-bottom: 80px; /* Increased from 60px to move it higher */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.success-song-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.2;
}

.success-artist-name {
    font-size: 1.3rem;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.2;
}

.success-subtitle {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    width: 100%;
}

/* Music Note Animations */
.music-notes {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.music-note {
    position: absolute;
    color: var(--neon-pink);
    font-size: 24px;
    animation: float-note 1.5s linear forwards;
    opacity: 0;
}

@keyframes float-note {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
    }
}

/* Autocomplete Styling */
.autocomplete-container {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: rgba(0, 0, 100, 0.8)!important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999; /* Extremely high z-index to ensure it appears above all elements */
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

/* Remove iOS-specific fixes that might be causing issues */
/* Instead, use a more direct approach to ensure dropdowns work */
.autocomplete-container {
    /* Default state - hidden */
    display: none;
}

/* When explicitly set to block via JavaScript */
.autocomplete-container[style*="display: block"],
.autocomplete-container.visible,
.input-group.dropdown-open .autocomplete-container {
    /* Force display with highest priority */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Fix for dropdown cutoff at 768px and above */
@media (min-width: 768px) {
    .autocomplete-container {
        position: absolute;
        max-height: 300px; /* Increased max-height */
        overflow-y: auto;
        /* Ensure the container isn't constrained by parent overflow */
        z-index: 9999; /* Extremely high z-index to ensure it appears above all elements */
    }
    
    /* Ensure the app container doesn't clip the dropdown */
    .app-container {
        overflow: visible;
    }
    
    /* Ensure the form container doesn't clip the dropdown */
    .form-group {
        position: relative;
        overflow: visible;
    }
}

.autocomplete-item {
    padding: 6px 45px 6px 18px; /* Add right padding to prevent overlap */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    font-size: 17px;
    position: relative;
}

/* Remove all background colors and borders from nested elements */
.autocomplete-item * {
    background-color: transparent !important;
    border: none !important;
}

.autocomplete-item:hover {
    background-color: rgba(100, 75, 209, 0.3);
}

/* Enhanced Loading Indicator */
.loading-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    display: none;
    z-index: 10;
    background-color: rgba(94, 23, 235, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    transition: all 0.3s ease;
}

.loading-indicator i {
    font-size: 18px;
}

.loading-indicator.active {
    display: block;
    box-shadow: 0 0 10px rgba(94, 23, 235, 0.5);
}

.loading-indicator.active i {
    animation: spin 1s linear infinite;
}

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

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

.autocomplete-container::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 0;
}

.autocomplete-container::-webkit-scrollbar-thumb {
    background: var(--icon-bg);
    border-radius: 0 8px 8px 0;
}

.autocomplete-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
    box-shadow: 0 0 5px rgba(108, 75, 209, 0.5);
}

.autocomplete-container::-webkit-scrollbar-button {
    display: none;
}

.autocomplete-container::-webkit-scrollbar-corner {
    background: transparent;
}

.autocomplete-header {
    display: none; /* Hide the headers */
}

.autocomplete-item strong {
    font-weight: 600;
    color: #00ffff;
}

.autocomplete-item .song-artist {
    opacity: 0.7;
    font-size: 0.9em;
    margin-left: 5px;
}

.autocomplete-item .song-album {
    opacity: 0.6;
    font-size: 0.8em;
    font-style: italic;
    margin-left: 5px;
}

.source-badge {
    font-size: 0.7em;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 8px;
    margin-left: 5px;
    opacity: 0.7;
}

.source-badge .fa-spotify {
    color: var(--spotify-green);
}

.autocomplete-item.selected {
    background-color: rgba(100, 75, 209, 0.3); /* Match the hover color */
    color: white !important;
}


/* Clear button styling - positioned inside input field */
.clear-input {
    position: absolute;
    right: 3px;
    top: 3px;
    bottom: 3px;
    background: rgba(94, 23, 235, 0.7);
    color: white;
    cursor: pointer;
    display: none;
    z-index: 10;
    padding: 0 15px;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
    min-width: 45px;
    align-items: center;
    justify-content: center;
    border: none;
}

.clear-input:hover {
    background: rgba(255, 77, 77, 0.8);
    color: white;
    transform: scale(1.02);
}

.clear-input i {
    font-size: 1.4rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: 0.8;
}

/* Hide clear button by default */
.clear-input[style*="display: none"] {
    display: none !important;
}

/* Show clear button when needed */
.clear-input[style*="display: block"],
.clear-input[style*="display: flex"] {
    display: flex !important;
}

/* When clear button is visible, keep input field border radius intact */
.input-group.has-clear-button .form-control {
    padding-right: 60px !important; /* Make room for clear button */
    /* Keep original border radius - don't change it */
}

.input-group.has-clear-button .form-control:focus {
    /* Keep original border radius - don't change it */
}

/* Add padding to the right of input fields to make room for the clear button */
/* Note: .input-group position is already defined in the Input Group Styles section */

/* Position adjustment for loading indicator to not overlap with clear button */
.loading-indicator {
    right: 35px;
}

/* Removed pulsating effect to eliminate purple box shadow */
.input-group.searching {
    border-color: var(--icon-bg);
}

/* Search Status Message */
.search-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    text-align: center;
    min-height: 20px;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.search-status.visible {
    opacity: 1;
}

.search-status.error {
    color: var(--error);
}

.search-status.success {
    color: var(--success);
}

/* Song ticker scrollbar styling has been removed */

/* Enhanced dark mode styles for better readability */
@media (prefers-color-scheme: dark) {
    /* Improved input styling for better contrast - MOBILE ONLY */
    @media (max-width: 768px) {
        .input-group {
            border: 1px solid rgba(255, 255, 255, 0.4) !important; /* Thinner border for mobile */
            box-shadow: none !important;
            background: transparent !important; /* Keep transparent like light mode */
            overflow: visible;
            border-radius: 12px !important; /* Ensure border radius is maintained */
        }
    }
    
    /* Desktop dark mode - keep original subtle borders */
    @media (min-width: 769px) {
        .input-group {
            border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Subtle border for desktop */
            box-shadow: none !important;
            background: transparent !important;
            overflow: visible;
            border-radius: 12px !important;
        }
    }
    
    .form-control {
        background-color: rgba(30, 30, 50, 0.6) !important; /* Match light mode transparency */
        color: white !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .form-control::placeholder {
        color: rgba(255, 255, 255, 0.8) !important; /* More visible placeholder */
    }
    
    .form-control:focus {
        background-color: rgba(30, 30, 50, 0.8) !important; /* Match light mode transparency */
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        outline-offset: 0 !important;
    }
    
    /* Ensure labels are visible */
    .form-label {
        color: white !important;
        text-shadow: 0 0 5px rgba(0, 0, 0, 0.7) !important;
    }
    
    /* App container improvements */
    .app-container {
        background: rgba(26, 26, 46, 0.7) !important; /* Match light mode transparency */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    /* Remove submit button border override from general dark mode - let base styles handle it */
    
}

/* Lookup styles have been moved to lookup-styles.css to avoid conflicts */

/* ========================================
   TIPPING MODAL STYLES
   ======================================== */

/* Modal Overlay */
.tip-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
    /* Ensure modal can scroll on mobile */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tip-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Add padding for mobile safe areas */
    padding: 20px;
    min-height: 100%;
}

/* Modal Content - Default Dark Theme */
.tip-modal-content {
    background: #1a1a1a; /* Dark background by default */
    color: #ffffff; /* White text by default */
    margin: 20px auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    /* Remove max-height constraint for mobile */
    max-height: none;
    overflow: visible;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease-out;
    font-family: 'Poppins', sans-serif;
    /* Ensure content is fully accessible */
    flex-shrink: 0;
}

/* Modal Header */
.tip-modal-header {
    background: #4361ee; /* Solid color, no gradient */
    color: white;
    padding: 20px 25px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.tip-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-modal-header h3 i {
    color: #ff6b9d;
    font-size: 18px;
}

.tip-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.tip-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Mobile-specific fix for close button positioning */
@media (max-width: 768px) {
    .tip-modal-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        /* Ensure proper centering */
        text-align: center;
        vertical-align: middle;
    }
    
    .tip-modal-close::before {
        content: '';
        display: inline-block;
        height: 100%;
        vertical-align: middle;
        width: 0;
    }
}

/* Modal Body */
.tip-modal-body {
    padding: 25px;
}

/* Tip Amounts Section */
.tip-amounts {
    margin-bottom: 25px;
}

.tip-amounts h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff; /* White text by default for dark theme */
}

.tip-amount-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.tip-amount-btn {
    padding: 12px 8px;
    border: 2px solid #404040; /* Dark border by default */
    background: #2a2a2a; /* Dark background by default */
    color: #cccccc; /* Light text by default */
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.tip-amount-btn:hover {
    background: #333333; /* Darker background on hover */
    border-color: #4361ee;
    color: #4361ee;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.tip-amount-btn.selected {
    background: #4361ee; /* Solid color, no gradient */
    border-color: #4361ee;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

/* Custom Amount */
.custom-amount-container {
    border-top: 1px solid #404040; /* Dark border by default */
    padding-top: 15px;
}

.custom-amount-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ffffff; /* White text by default */
    font-size: 14px;
}

.custom-amount-container {
    position: relative;
}

.custom-amount-container input {
    width: 100%;
    padding: 12px 15px 12px 35px; /* Add left padding for dollar sign */
    border: 2px solid #404040; /* Dark border by default */
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #2a2a2a; /* Dark background by default */
    color: #ffffff; /* White text by default */
    /* Remove spinner arrows */
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Dollar sign removed - will be handled by placeholder text instead */

/* Remove spinner arrows for WebKit browsers */
.custom-amount-container input::-webkit-outer-spin-button,
.custom-amount-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove spinner arrows for Firefox */
.custom-amount-container input[type=number] {
    -moz-appearance: textfield;
}

.custom-amount-container input:focus {
    outline: none;
    background: #333333; /* Darker background on focus */
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Payment Methods Section */
.payment-methods {
    margin-bottom: 25px;
}

.payment-methods h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff; /* White text by default for dark theme */
}

.payment-method-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-method-btn {
    padding: 20px 25px; /* Increased padding for taller buttons */
    border: 2px solid #404040; /* Dark border by default */
    background: #2a2a2a; /* Dark background by default */
    color: #ffffff; /* White text by default for dark theme */
    border-radius: 8px;
    font-size: 20px; /* Increased from 16px */
    font-weight: 600; /* Increased from 500 */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the content */
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.payment-method-btn i {
    font-size: 26px; /* Increased from 20px */
    width: 30px; /* Fixed width */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px; /* Space between icon and text */
}

.payment-method-btn span {
    font-weight: 700; /* Increased from 600 */
}

.payment-method-btn:hover {
    background: #333333; /* Darker background on hover */
    border-color: #4895ef;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.payment-method-btn.selected {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Venmo specific styling */
.venmo-btn {
    background: #e0e0e0 !important; /* More grey when not selected */
    border-color: #cccccc !important;
    color: #666666 !important; /* Grey text */
    -webkit-text-fill-color: #666666 !important;
    opacity: 0.6;
}

.venmo-btn:hover {
    background: #d0d0d0 !important;
    border-color: #3d95ce !important;
    color: #3d95ce !important;
    -webkit-text-fill-color: #3d95ce !important;
    opacity: 0.8;
}

.venmo-btn.selected {
    background: #3d95ce !important; /* Full company color when selected */
    border-color: #3d95ce !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
    opacity: 1;
}

.venmo-btn i {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

/* PayPal specific styling */
.paypal-btn {
    background: #e0e0e0 !important; /* More grey when not selected */
    border-color: #cccccc !important;
    color: #666666 !important; /* Grey text */
    -webkit-text-fill-color: #666666 !important;
    opacity: 0.6;
}

.paypal-btn:hover {
    background: #d0d0d0 !important;
    border-color: #0070ba !important;
    color: #0070ba !important;
    -webkit-text-fill-color: #0070ba !important;
    opacity: 0.8;
}

.paypal-btn.selected {
    background: #0070ba !important; /* Full company color when selected */
    border-color: #0070ba !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
    opacity: 1;
}

.paypal-btn i {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

/* Cash App specific styling */
.cashapp-btn {
    background: #e0e0e0 !important; /* More grey when not selected */
    border-color: #cccccc !important;
    color: #666666 !important; /* Grey text */
    -webkit-text-fill-color: #666666 !important;
    opacity: 0.6;
}

.cashapp-btn:hover {
    background: #d0d0d0 !important;
    border-color: #00d632 !important;
    color: #00d632 !important;
    -webkit-text-fill-color: #00d632 !important;
    opacity: 0.8;
}

.cashapp-btn.selected {
    background: #00d632 !important; /* Full company color when selected */
    border-color: #00d632 !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
    opacity: 1;
}

.cashapp-btn i {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

/* Optional Fields */
.tip-optional-fields {
    margin-bottom: 25px;
}

.tip-optional-fields .form-group {
    margin-bottom: 15px;
}

.tip-optional-fields .form-group:last-child {
    margin-bottom: 0;
}

.tip-optional-fields label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #b0b0b0; /* Dark mode by default */
    font-size: 14px;
}

.tip-optional-fields input,
.tip-optional-fields textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #555; /* Dark border by default */
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #333; /* Dark background by default */
    color: #e0e0e0; /* Light text by default */
    resize: vertical;
}

.tip-optional-fields input::placeholder,
.tip-optional-fields textarea::placeholder {
    color: #888888;
}

.tip-optional-fields input:focus,
.tip-optional-fields textarea:focus {
    outline: none;
    border-color: #4361ee;
    background: #3a3a3a; /* Slightly lighter on focus */
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.tip-optional-fields textarea {
    min-height: 60px;
    max-height: 120px;
}

/* Submit Button */
.tip-submit-btn {
    width: 100%;
    padding: 20px 25px; /* Match payment button padding for same height */
    background: #ff6b7d; /* Slightly more orange-tinted pink */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px; /* Match payment button font size */
    font-weight: 700; /* Match payment button font weight */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(255, 107, 125, 0.3);
    /* No animation */
}

.tip-submit-btn:hover:not(:disabled) {
    background: #ff5252; /* Darker orange-pink on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 125, 0.4);
}

.tip-submit-btn:disabled {
    background: #e1e5ee;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tip-submit-btn i {
    font-size: 20px; /* Increased to match button size */
}

/* Tip Button (Main Page) */
.tip-section {
    margin-top: 15px;
    text-align: center;
}

.tip-btn {
    background: #9d34e7 !important; /* Custom purple background - force to override any .btn styles */
    background-color: #9d34e7 !important; /* Explicit background-color */
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Same white border as REQUEST SONG button */
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 0 10px rgba(108, 75, 209, 0.5) !important; /* Same box-shadow as REQUEST SONG button */
    /* Prevent background color flashing */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    /* Override any browser defaults */
    outline: none !important;
    text-decoration: none !important;
}

.tip-btn:hover {
    background: var(--primary) !important; /* Use theme primary blue for hover - force to override any .btn styles */
    background-color: var(--primary) !important; /* Explicit background-color */
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Keep same white border on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 70, 185, 0.4);
}

.tip-btn:focus {
    background: #9d34e7 !important;
    background-color: #9d34e7 !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Keep same white border on focus */
    outline: none !important;
}

.tip-btn:active {
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Keep same white border on active */
}

.tip-btn i {
    font-size: 16px;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heartbeat {
    0%, 50%, 100% {
        transform: scale(1);
    }
    25%, 75% {
        transform: scale(1.1);
    }
}

/* Loading State */
.tip-submit-btn.loading {
    position: relative;
    color: transparent;
}

.tip-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success/Error Messages */
.tip-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
}

.tip-message.success {
    background: rgba(11, 181, 88, 0.1);
    border: 1px solid #0bb558;
    color: #0bb558;
}

.tip-message.error {
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid #e63946;
    color: #e63946;
}

/* Tip Redirect Overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

/* Dark mode support for redirect overlay */
@media (prefers-color-scheme: dark) {
    .tip-redirect-content {
        background: #1a1a1a !important;
        color: #ffffff !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
    }
    
    .tip-redirect-content p {
        color: #ffffff !important;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .app-container {
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
    }

    .event-title {
        font-size: 24px;
    }

    .main-content {
        padding: 80px 20px 15px 20px;
    }
    
    /* Additional mobile spacing for search input specifically */
    .main-content .form-group.search-input {
        margin-top: 18px;
        margin-bottom: 0; /* Remove bottom margin to match header-to-search spacing */
    }
    
    /* Match search input spacing for name input on mobile */
    .main-content .form-group.name-input {
        margin-top: 15px; /* Reduced from 18px to better match header-to-search spacing */
    }
    
    /* Adjust QR icon for mobile */
    .qr-code-icon {
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .qr-code-icon i {
        font-size: 18px;
    }
    
    .share-text {
        font-size: 10px;
    }

    .success-message {
        font-size: 32px;
    }

    /* Song and artist inputs stack on mobile */
    .song-artist-row {
        flex-direction: column;
        gap: 0px;
    }

    .form-group.name-input {
        margin-top: 18px; /* Match the search input spacing */
        margin-bottom: 35px;
    }
    
/* Make label spacing consistent between search and name inputs */
.form-group.name-input .form-label,
.form-group.search-input .form-label {
    margin-bottom: 6px; /* Consistent spacing for both labels */
}
    
    .lookup-btn {
        min-width: 45px;
        padding: 0 12px;
        font-size: 13px;
    }
    
    .lookup-results {
        position: absolute;
        top: 100%;
        left: 10px;
        right: 10px;
        z-index: 9999;
        max-height: 250px;
        margin-top: 2px;
    }
    
    .result-item {
        padding: 15px 35px 15px 15px; /* More space for text on mobile */
        min-height: 50px;
        gap: 12px;
        align-items: flex-start; /* Ensure top alignment on mobile */
    }
    
    .result-item i {
        width: 18px;
        flex-shrink: 0; /* Prevent icon from shrinking */
    }
    
    .result-text {
        font-size: 16px; /* Prevent iOS zoom */
        flex: 1; /* Allow text to take available space */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.3;
        max-width: calc(100% - 30px); /* Ensure text doesn't overlap with match indicator on mobile */
        overflow: hidden;
    }
    
    .result-meta {
        font-size: 0.8em;
        line-height: 1.2;
    }
    
    /* Match indicator positioning for mobile */
    .match-indicator {
        position: absolute;
        right: 5px; /* Closer to edge on mobile */
        top: 15px; /* Fixed position from top instead of center */
        transform: none; /* Remove center transform */
        font-size: 0.65em;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    
    .tip-modal {
        /* Ensure full viewport coverage on mobile */
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for modern browsers */
        /* Add safe area padding for notched devices */
        padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 10px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 10px);
    }
    
    .tip-modal.show {
        align-items: center;
        padding: 10px;
        /* Ensure proper padding on all sides */
        padding: max(20px, env(safe-area-inset-top, 20px)) 10px max(20px, env(safe-area-inset-bottom, 20px)) 10px;
    }
    
    .tip-modal-content {
        margin: 0 auto;
        width: 95%;
        max-width: 450px;
        max-height: 90vh;
        /* Allow natural height expansion */
        height: auto;
        /* Ensure content is scrollable if needed */
        overflow: visible;
        border-radius: 20px;
    }
    
    .tip-modal-header {
        padding: 15px 20px;
        /* Ensure header is always visible */
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .tip-modal-header h3 {
        font-size: 18px;
    }
    
    .tip-modal-body {
        padding: 20px;
        /* Add bottom padding to ensure Send Tip button is fully visible */
        padding-bottom: max(30px, env(safe-area-inset-bottom, 30px));
    }
    
    .tip-amount-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .tip-amount-btn {
        padding: 10px 6px;
        font-size: 14px;
    }
    
    .payment-method-btn {
        padding: 15px 20px; /* Keep taller on mobile too */
        font-size: 18px; /* Increased from 15px */
        justify-content: center; /* Center content on mobile too */
    }
    
    .payment-method-btn i {
        font-size: 24px; /* Increased from 18px */
    }
    
    .tip-submit-btn {
        padding: 15px 20px; /* Keep taller on mobile too */
        font-size: 18px; /* Match payment button mobile font size */
    }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) {
    /* Song-artist row remains in a row on iPad */
    .song-artist-row {
        flex-direction: row;
    }

    /* Larger elements for iPad touch targets */
    .input-group {
        height: 60px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .event-title {
        font-size: 20px;
    }

    .event-date {
        font-size: 14px;
    }

    .code-title {
        font-size: 24px;
    }

    .code-input {
        font-size: 20px;
        letter-spacing: 5px;
    }

    .success-message {
        font-size: 26px;
    }
    
    .tip-modal {
        /* Full screen on small devices */
        padding: 0;
        height: 100vh;
        height: 100dvh;
    }
    
    .tip-modal.show {
        padding: 10px;
        align-items: center;
        justify-content: center;
    }
    
    .tip-modal-content {
        margin: 0 auto;
        border-radius: 16px;
        width: 95%;
        max-width: 400px;
        height: auto;
        max-height: 85vh;
        /* Keep it as a centered modal even on small devices */
        display: flex;
        flex-direction: column;
    }
    
    .tip-modal-header {
        border-radius: 16px 16px 0 0;
        padding: 15px 20px;
        flex-shrink: 0;
    }
    
    .tip-modal-body {
        padding: 15px;
        /* Make body scrollable and fill remaining space */
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Add bottom padding for home indicator */
        padding-bottom: max(25px, env(safe-area-inset-bottom, 25px));
    }
    
    .tip-amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tip-amounts h4,
    .payment-methods h4 {
        font-size: 15px;
    }
    
    /* Ensure submit button is always accessible */
    .tip-submit-btn {
        margin-top: 20px;
        margin-bottom: 10px;
    }
}

/* Mobile-specific styles are now handled by the standard responsive design */
