/* Check-in App Styles - Matching wedding theme */
:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #111111;
    --text-dark: #111111;
    --text-light: #333333;
    --text-muted: #666666;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #000000;
}

* {
    box-sizing: border-box;
}

html {
    background: transparent !important;
}

/* Global Background Setup */
body {
    font-family: 'Lato', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
    background: transparent;
    touch-action: manipulation;
    /* Optimize for mobile performance */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Prevent zoom on input focus */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* iPad PWA optimizations */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    /* Allow QR scanner modal to work properly */
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

/* Allow text selection for input fields and guest names */
input,
textarea,
.guest-name,
.guest-details {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Background image - matching landing.html style (no blur, opacity 0.4) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/landing-pic.jpg') center/cover no-repeat fixed;
    background-attachment: fixed;
    filter: brightness(0.8) contrast(1.1);
    opacity: 0.4;
    z-index: -1;
    transform: translateZ(0);
    will-change: auto;
}

/* Adjust background position for iPad landscape and laptop screens */
@media (min-width: 768px) and (orientation: landscape),
(min-width: 1024px) {
    body::before {
        background-position: center 30%;
    }
}



/* Enhanced container spacing */
.checkin-container {
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Clean Guest Grid - Compact Layout */
.guests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
    /* Ensure all guests fit without scrolling */
    max-width: 100%;
    margin: 0 auto;
}

/* iPad-specific grid adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .guests-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 16px;
        padding: 20px 24px;
    }
}

/* Enhanced typography */
.guest-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.guest-details {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
    animation: fadeIn 0.3s ease;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    color: var(--text-muted);
}

.empty-state h3 {
    font-family: 'Lato', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.7;
    color: var(--text-muted);
}

/* Loading skeleton for search results */
.search-skeleton {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.search-skeleton-item {
    height: 20px;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.06) 0%,
            rgba(0, 0, 0, 0.12) 50%,
            rgba(0, 0, 0, 0.06) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 8px;
}

.search-skeleton-item:first-child {
    width: 60%;
}

.search-skeleton-item:last-child {
    width: 40%;
    margin-bottom: 0;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Enhanced loading states */
.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Neumorphism background pattern */

#wrapper {
    background: transparent !important;
}

.main {
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Hide preloader completely */
#preloader {
    display: none !important;
}



/* Main Container */
.checkin-container {
    position: relative;
    z-index: 10;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    min-height: 100vh;
    height: 100vh;
    /* Allow QR scanner modal to work properly */
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    /* Ensure proper spacing for status badge */
    padding-bottom: 90px;
}

/* Disable vertical scroll on home page (when cards are visible) */
body.home-page {
    overflow-y: hidden !important;
}

/* When search is active, allow scroll for dropdown */
body.search-active {
    overflow-y: auto !important;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 0.01px 20px 5px;
    background: transparent;
    width: 100%;
    max-width: 600px;
    position: absolute;
    top: 0.01px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}



.hero-content {
    position: relative;
}

.header-logo img {
    width: 150px;
    height: auto;
    margin-bottom: 15px;
    margin-top: 25px;
}

.couple-names {
    font-family: 'Tan Mon Cheri', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 10px 0 20px;
    font-weight: normal;
    text-shadow: 0 1px 3px rgba(44, 24, 16, 0.1);
    background: none !important;
}


@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Smooth animations for better UX */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes scanSuccess {
    0% {
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 0 0 rgba(40, 167, 69, 0);
    }

    50% {
        border-color: var(--success-color);
        box-shadow: 0 0 30px rgba(40, 167, 69, 0.7);
    }

    100% {
        border-color: var(--success-color);
        box-shadow: 0 0 30px rgba(40, 167, 69, 0.7);
    }
}

/* Professional Search Section */
.search-section {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-large);
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 32px;
    /* Optimize for mobile performance */
    will-change: transform;
    transform-style: preserve-3d;
    z-index: 5;
    transition: all 0.2s ease;
}

/* Handle keyboard on mobile */
@media (max-height: 600px) {
    .search-section {
        top: 40%;
        padding: 20px;
    }

    .hero-section {
        padding: 10px 20px 5px;
    }
}

/* Search Dropdown - Redesigned */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    max-height: none;
    overflow: visible;
    z-index: 9999;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Ensure search container doesn't shift when dropdown appears */
.search-container {
    padding: 30px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.search-form {
    position: relative;
    overflow: visible;
    z-index: 2;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Search icon */
.search-input-container::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-85%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.search-input-container:focus-within::before {
    color: var(--primary-color);
}

.search-input {
    width: 100%;
    padding: 20px 56px 20px 56px;
    font-size: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-dark);
    font-family: 'Lato', sans-serif;
    transition: all 0.2s ease;
    margin-bottom: 24px;
    line-height: 1.4;
    /* Optimize for mobile performance */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.search-clear-btn {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-105%) !important;
    width: 18px !important;
    height: 18px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 50% !important;
    color: var(--text-light) !important;
    cursor: pointer !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    font-size: 1.1rem !important;
    z-index: 3 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.search-clear-btn:hover {
    background: rgba(107, 78, 61, 0.15);
    color: var(--text-dark);
}

.search-clear-btn.visible {
    display: flex;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced focus-visible for better accessibility */
.search-input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
}

.search-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

/* Search Actions */
.search-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.search-button,
.qr-button {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-button {
    background: var(--primary-color);
    color: white;
}

.search-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.qr-button {
    background: var(--accent-color);
    color: white;
}

.qr-button:hover {
    background: #2d0f12;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Professional QR Scan Card */
.qr-scan-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 255, 255, 0.95));
    border-radius: 12px;
    padding: 24px;
    margin: 24px auto 0;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-light);
    width: 85%;
    max-width: 500px;
    position: relative;
    overflow: hidden;
    /* Optimize for mobile performance */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Improve touch response */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Subtle gradient overlay on hover */
.qr-scan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.qr-scan-card:hover::before {
    opacity: 1;
}

.qr-scan-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.qr-scan-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #333333);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    flex-shrink: 0;
}

.qr-scan-card:hover .qr-scan-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Pulsing animation to draw attention */
.qr-scan-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    opacity: 0;
    animation: qr-pulse 2s ease-in-out infinite;
}

@keyframes qr-pulse {

    0%,
    100% {
        opacity: 0;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.qr-scan-content h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-dark);
}

.qr-scan-content p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-light);
}

/* Hide QR card when search dropdown has results - More specific selector */
.search-container .search-dropdown.has-results~.qr-scan-card {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.search-dropdown-item {
    padding: 20px 24px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
}

/* Visual indicator for checked-in parties */
.search-dropdown-item.checked-in-party {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.search-dropdown-item.checked-in-party::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 0 2px 2px 0;
}

/* Success icon for fully checked-in parties */
.search-dropdown-item.checked-in-party .checkin-status::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #10b981;
    margin-right: 6px;
    font-size: 0.9rem;
}

.search-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.search-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

/* Search highlighting - smooth background that doesn't break text flow */
.search-highlight {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.35), rgba(255, 152, 0, 0.3));
    color: inherit;
    font-weight: inherit;
    padding: 1px 2px;
    border-radius: 2px;
    display: inline;
    box-shadow: none;
    position: relative;
    /* Ensure smooth text flow */
    line-height: inherit;
    vertical-align: baseline;
}

.search-dropdown-item:hover,
.search-dropdown-item.highlighted {
    background: rgba(65, 24, 26, 0.08);
    transform: translateX(4px);
    padding-left: 28px;
}

.search-dropdown-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background: rgba(65, 24, 26, 0.05);
}

.guest-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0;
}

.suggestion-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.guest-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.guest-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0;
    line-height: 1.3;
}

.guest-table {
    font-size: 0.8rem;
    font-weight: 500;
    color: #7f8c8d;
    font-style: italic;
    display: block;
    margin: 2px 0 0 0;
}

.party-info {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-light);
    opacity: 0.8;
}

.checkin-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.checkin-count {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-light);
    opacity: 0.8;
    white-space: nowrap;
}

/* More results message */
.search-dropdown-more {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(65, 24, 26, 0.02);
    border-radius: 0 0 12px 12px;
    animation: fadeIn 0.3s ease;
}

.more-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.more-results-message span:first-child {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.more-results-message span:last-child {
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.7;
}

.search-status-message {
    text-align: center;
    color: var(--text-light);
    margin-top: 15px;
    font-size: 0.9rem;
}

.search-status-message.error {
    color: var(--danger-color);
    font-weight: 500;
}

/* Check-In Page */
.checkin-page {
    width: 100%;
    max-width: 700px;
}

/* Main Container */
.checkin-container {
    background: transparent !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}



/* Party Header */
.checkin-page .party-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--accent-color);
}

.checkin-page .party-name {
    font-family: 'Tan Mon Cheri', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0 0 20px;
    font-weight: normal;
}

.checkin-page .party-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Guests Grid */
.checkin-page .guests-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.checkin-page .guest-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkin-page .guest-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.checkin-page .guest-item.checked-in {
    background: rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
    border-width: 2px;
}

.checkin-page .guest-info {
    text-align: center;
    flex: 1;
}

.checkin-page .guest-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px;
}

.checkin-page .guest-status {
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
    color: var(--text-light);
}

.checkin-page .guest-status.checked-in {
    color: #16a34a;
}

/* Party Actions */
.checkin-page .party-actions {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hide hero section completely when on check-in page */
.checkin-page .hero-section {
    display: none !important;
}

/* Hide any other elements that might show from search view */
.checkin-page .search-section {
    display: none !important;
}



/* Hide old couple names display */
.couple-names {
    display: none;
}

/* Back Button for Check-in Page - FIXED */
.checkin-page .back-button-container {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
    z-index: 99999 !important;
}

.checkin-page .back-button {
    background: var(--accent-color) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    min-width: 100px !important;
    justify-content: center !important;
    text-decoration: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.checkin-page .back-button:hover {
    background: rgba(65, 24, 26, 0.1);
    color: var(--text-dark);
    border: 2px solid var(--accent-color);
    transform: translateY(-1px);
}

.party-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
}

.party-name {
    font-family: 'Tan Mon Cheri', serif;
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0 0 10px;
    font-weight: normal;
}

.party-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.confirmation-code,
.party-code {
    background: #000000 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    color: #ffffff !important;
    border: none !important;
    display: inline-block !important;
    width: auto !important;
    max-width: fit-content !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
}

/* Guests List */
.guests-list {
    margin-bottom: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.guest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.guest-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
}

.guest-item.checked-in {
    background: rgba(22, 163, 74, 0.1);
    border-color: var(--accent-color);
    border-width: 2px;
}

.guest-item.checked-in::before {
    display: none;
    /* Remove the left line */
}

.guest-info {
    flex: 1;
    text-align: center;
}

.guest-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
    margin-bottom: 4px;
}

.guest-status {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    font-weight: 500;
}

.guest-status.checked-in {
    color: #16a34a;
    font-weight: 500;
}

.guest-actions {
    display: none;
    /* Hide toggle actions - now using clickable cards */
}

.checkin-toggle {
    display: none;
    /* Hide toggle - now using clickable cards */
}

/* Party Actions */
.party-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-outline {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* PWA touch handling */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

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

.btn-primary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    border: 2px solid var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Sync Status Badge (Bottom Left) */
.sync-status-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 10px 18px;
    border: 1px solid rgba(65, 24, 26, 0.08);
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    z-index: 1000;
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    user-select: none;
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    /* No entry animation - static pill */
}

.sync-status-badge:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.95));
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(65, 24, 26, 0.12);
}

.sync-status-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Syncing state - only dot animates, pill stays static */
.sync-status-badge.syncing .status-dot {
    background: linear-gradient(135deg, #ff8c00, #ff6b35);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 140, 0, 0.2),
        0 0 8px rgba(255, 140, 0, 0.4);
    animation: dot-pulse 2s ease-in-out infinite;
}

.sync-status-badge.syncing .status-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    animation: status-dot-glow 2s ease-in-out infinite;
}



@keyframes status-dot-glow {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0px);
    }

    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.4);
        filter: blur(1px);
    }
}

@keyframes dot-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.8) translateY(-10px);
    }

    100% {
        opacity: 1;
        visibility: visible;
        transform: scale(1) translateY(0);
    }
}

@keyframes saving-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 2px 16px rgba(255, 140, 0, 0.1),
            0 1px 3px rgba(0, 0, 0, 0.04),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    50% {
        transform: scale(1.02);
        box-shadow:
            0 4px 24px rgba(255, 140, 0, 0.15),
            0 2px 6px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
}

@keyframes saved-success {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin-smooth {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes checkmark-bounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Add click feedback */
.sync-status-badge:active {
    transform: scale(0.95);
}

/* Focus state for accessibility - minimal outline */
.sync-status-badge:focus {
    outline: none;
}

.sync-status-badge:focus-visible {
    outline: none;
}

.sync-badge-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.sync-status-badge .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sync-status-badge .status-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    animation: status-dot-glow 3s ease-in-out infinite;
}

.sync-status-badge .status-text {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-dark);
}

/* Check-in Counter (Bottom Right) */
.checkin-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    padding: 10px 18px;
    border: 1px solid rgba(65, 24, 26, 0.08);
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.checkin-counter:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.95));
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(65, 24, 26, 0.12);
}

.checkin-counter:active {
    transform: translateY(0) scale(0.98);
}

.checkin-counter-number {
    font-size: 0.8rem;
    font-weight: 700;
    transition: color 0.3s ease, transform 0.15s ease;
}

.checkin-counter-separator {
    font-weight: 500;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: color 0.3s ease;
}

.checkin-counter-total {
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

/* In-progress state: yellow/yellow */
.checkin-counter.in-progress .checkin-counter-number,
.checkin-counter.in-progress .checkin-counter-total {
    color: #f59e0b;
    /* Amber/yellow color */
}

.checkin-counter.in-progress .checkin-counter-separator {
    color: #f59e0b;
    opacity: 0.6;
}

/* Complete state: green/green */
.checkin-counter.complete .checkin-counter-number,
.checkin-counter.complete .checkin-counter-total {
    color: var(--success-color);
    /* Green color */
}

.checkin-counter.complete .checkin-counter-separator {
    color: var(--success-color);
    opacity: 0.6;
}

/* Stats Panel - Similar to device info panel */
.stats-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(65, 24, 26, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
    color: var(--text-light);
    z-index: 999;
    min-width: 280px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    pointer-events: none;
    overflow: hidden;
}

.stats-panel.expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-color: rgba(65, 24, 26, 0.2);
    animation: fadeInPanel 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.stats-label {
    font-weight: 500;
    color: var(--text-dark);
    min-width: 100px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.stats-value {
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
    font-size: 0.75rem;
    white-space: nowrap;
}

.stats-value.highlight {
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

/* In-progress state: yellow/amber */
.stats-panel.in-progress .stats-value.highlight {
    color: #f59e0b;
    /* Amber/yellow color */
}

/* Complete state: green */
.stats-panel.complete .stats-value.highlight {
    color: var(--success-color);
    /* Green color */
}

.stats-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-top: 4px;
}

.stats-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
    width: 0%;
    position: relative;
}

/* In-progress state: yellow/amber gradient */
.stats-panel.in-progress .stats-progress-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Complete state: green gradient */
.stats-panel.complete .stats-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

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

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

    100% {
        transform: translateX(100%);
    }
}

.stats-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(65, 24, 26, 0.1);
}

.stats-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Device Info Panel (Bottom Left - Hidden by default) */
.device-info-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(65, 24, 26, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
    color: var(--text-light);
    z-index: 999;
    min-width: 240px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    pointer-events: none;
    overflow: hidden;
}

.device-info-panel.expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-color: rgba(65, 24, 26, 0.2);
    animation: fadeInPanel 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInPanel {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.device-info-panel:hover {
    opacity: 1;
}

.device-info-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.device-id-info,
.last-sync-info,
.sync-status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.device-label,
.sync-label,
.status-label {
    font-weight: 500;
    color: var(--text-dark);
    min-width: 45px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.device-value,
.sync-value {
    font-weight: 400;
    color: var(--text-light);
    text-align: right;
    font-size: 0.65rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: visible;
}

.status-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 0.65rem;
    opacity: 0.8;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-text {
    font-size: 0.65rem;
    white-space: nowrap;
}

/* Sync status states for both badge and expanded panel */
.sync-status-badge.offline .status-dot,
.device-info-panel.offline .status-dot {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(108, 117, 125, 0.2);
}

.sync-status-badge.online .status-dot,
.device-info-panel.online .status-dot {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(40, 167, 69, 0.2);
}

.sync-status-badge.syncing .status-dot,
.device-info-panel.syncing .status-dot {
    background: linear-gradient(135deg, #ff8c00, #ff6b35);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 140, 0, 0.2);
    animation: syncing-pulse 1.5s ease-in-out infinite;
}

.sync-status-badge.synced .status-dot,
.device-info-panel.synced .status-dot {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(40, 167, 69, 0.2);
}

.sync-status-badge.not-synced .status-dot,
.device-info-panel.not-synced .status-dot {
    background: linear-gradient(135deg, #fd7e14, #e74c3c);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(253, 126, 20, 0.2);
}

/* Responsive adjustments for stats panel */
@media (max-width: 768px) {
    .stats-panel {
        bottom: calc(env(safe-area-inset-bottom) + 16px);
        right: max(15px, env(safe-area-inset-right));
        min-width: 260px;
        max-width: 300px;
        padding: 16px 20px;
        font-size: 0.7rem;
    }

    .stats-panel-title {
        font-size: 0.85rem;
    }

    .stats-label {
        font-size: 0.65rem;
        min-width: 90px;
    }

    .stats-value {
        font-size: 0.7rem;
    }

    .checkin-counter {
        bottom: 15px;
        right: 15px;
        padding: 8px 14px;
        font-size: 0.7rem;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        bottom: calc(env(safe-area-inset-bottom) + 12px);
        right: max(10px, env(safe-area-inset-right));
        min-width: 240px;
        max-width: 280px;
        padding: 14px 16px;
        font-size: 0.65rem;
    }

    .stats-panel-title {
        font-size: 0.8rem;
    }

    .stats-label {
        font-size: 0.6rem;
        min-width: 80px;
    }

    .stats-value {
        font-size: 0.65rem;
    }

    .checkin-counter {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.65rem;
        min-width: 65px;
    }
}

/* Responsive adjustments for sync badge and device info panel */
@media (max-width: 768px) {
    .sync-status-badge {
        bottom: max(15px, env(safe-area-inset-bottom));
        left: max(15px, env(safe-area-inset-left));
        padding: 8px 18px;
        font-size: 0.75rem;
        min-width: 90px;
        z-index: 100;
    }

    .sync-status-badge .status-dot {
        width: 8px;
        height: 8px;
    }

    .sync-status-badge .status-text {
        font-size: 0.75rem;
    }

    .device-info-panel {
        bottom: 15px;
        left: 15px;
        padding: 16px 20px;
        font-size: 0.75rem;
        min-width: 240px;
        max-width: 320px;
        border-radius: 16px;
    }

    .device-label,
    .sync-label,
    .status-label {
        font-size: 0.7rem;
        min-width: 45px;
    }

    .device-value,
    .sync-value,
    .status-value {
        font-size: 0.65rem;
    }

    .status-text {
        font-size: 0.65rem;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .sync-status-badge {
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        padding: 8px 16px;
        font-size: 0.7rem;
        min-width: 90px;
        z-index: 100;
    }

    .sync-status-badge .status-dot {
        width: 7px;
        height: 7px;
    }

    .sync-status-badge .status-text {
        font-size: 0.7rem;
    }

    .device-info-panel {
        bottom: 10px;
        left: 10px;
        padding: 14px 18px;
        font-size: 0.7rem;
        min-width: 220px;
        max-width: 280px;
        border-radius: 16px;
    }

    .device-label,
    .sync-label,
    .status-label {
        font-size: 0.65rem;
        min-width: 40px;
    }

    .device-value,
    .sync-value,
    .status-value {
        font-size: 0.6rem;
    }

    .status-text {
        font-size: 0.6rem;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    /* Optimize for performance */
    will-change: opacity, visibility;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* PWA touch handling */
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Enable interactions when shown */
    pointer-events: auto;
    animation: modalFadeIn 0.3s ease-out;
}

/* Fullscreen party modal - no padding */
#party-modal.modal.show {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Ensure modal content is interactive */
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h4 {
    margin: 0;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    /* PWA touch handling */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

.close-modal:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.close-modal:focus {
    outline: none;
}

.close-modal:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.modal-body {
    padding: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* QR Scanner Enhanced UI */
.qr-modal-content {
    max-width: 520px;
    width: 90%;
    background: white;
    padding: 12px;
    border-radius: 16px;
}

.qr-reader-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.qr-reader {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
    min-height: 280px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.qr-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.qr-loading i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.qr-loading p {
    font-size: 16px;
    margin: 0;
    opacity: 0.8;
}

/* Animated scanning frame overlay */
.qr-frame-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    pointer-events: none;
    z-index: 5;
}

.qr-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid white;
}

.qr-corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.qr-corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.qr-corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.qr-corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* QR Rotation Button */
.qr-rotate-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 20px;
    box-shadow: var(--shadow-medium);
    outline: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.qr-rotate-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
    border-color: var(--primary-color);
}

.qr-rotate-button:active {
    transform: scale(0.97) translateY(0);
    box-shadow: var(--shadow-light);
    background: rgba(255, 255, 255, 0.9);
}

.qr-rotate-button svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-dark);
    width: 20px;
    height: 20px;
}

.qr-rotate-button:active svg {
    transform: rotate(180deg);
}

.qr-rotate-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Hide rotate button on mobile */
@media (max-width: 767px) {
    .qr-rotate-button {
        display: none !important;
    }
}

.qr-instruction-text {
    text-align: center;
    margin: 12px 0 0;
    padding: 0;
    font-size: 0.95rem;
    color: #666;
}

/* Scan Feedback */
.qr-reader.scan-success {
    border-color: var(--success-color);
    border-width: 4px;
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.7);
    animation: scanSuccess 0.5s ease-out;
}

.qr-reader.scan-error {
    border-color: var(--danger-color);
    border-width: 4px;
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.7);
}

@keyframes scanSuccess {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}



/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    resize: vertical;
    min-height: 80px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

/* Toast Notifications - Less Intrusive Design */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-dark);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: slideInFromBottom 0.3s ease-out, fadeOutDown 0.3s ease-in 5.2s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    max-width: 320px;
    min-width: 240px;
    border: 1px solid rgba(65, 24, 26, 0.1);
    font-size: 1rem;
    pointer-events: auto;
}

.toast.success {
    border-left: 4px solid #28a745;
    background: rgba(248, 255, 249, 0.95);
}

.toast.error {
    border-left: 4px solid #dc3545;
    background: rgba(255, 248, 248, 0.95);
}

.toast.warning {
    border-left: 4px solid #ffc107;
    background: rgba(255, 252, 242, 0.95);
}

.toast.info {
    border-left: 4px solid #17a2b8;
    background: rgba(240, 249, 255, 0.95);
}

.toast-message {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
}

.toast-icon {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #28a745;
}

.toast.error .toast-icon {
    color: #dc3545;
}

.toast.warning .toast-icon {
    color: #ffc107;
}

.toast.info .toast-icon {
    color: #17a2b8;
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Toast responsive design */
@media (max-width: 768px) {
    .toast-container {
        bottom: 15px;
        left: 15px;
        right: 15px;
        transform: none;
        align-items: center;
    }

    .toast {
        max-width: none;
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .toast-container {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .toast {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .toast-message {
        font-size: 0.8rem;
    }

    .toast-icon {
        font-size: 0.8rem;
        width: 14px;
    }
}

/* Touch Optimizations for iPad */
@media (max-width: 1024px) {
    .checkin-container {
        padding: 15px 10px;
        gap: 20px;
    }

    .hero-section,
    .search-section,
    .party-section {
        max-width: 100%;
    }

    .search-container,
    .party-container {
        padding: 25px 20px;
    }

    .search-input {
        padding: 24px 28px;
        font-size: 20px;
        font-weight: 500;
    }

    .search-button,
    .qr-button {
        padding: 18px 32px;
        font-size: 1.1rem;
        min-width: 160px;
    }

    .guest-item {
        padding: 18px 20px;
    }

    .checkin-toggle {
        width: 60px;
        height: 34px;
    }

    .checkin-toggle::after {
        width: 30px;
        height: 30px;
    }

    .checkin-toggle.checked::after {
        transform: translateX(26px);
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-width: 95%;
    }

    /* QR Scanner Mobile Optimizations */
    .qr-reader {
        max-width: 100%;
        width: 100%;
        aspect-ratio: 1;
        min-height: 280px;
        max-height: 70vh;
    }

    .modal.show {
        padding: 15px;
    }

    .modal-body {
        padding: 20px;
    }
}

/* iPad Vertical Mode Specific Optimizations */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .search-section {
        max-width: 600px;
        /* Reduce width for better proportions */
        padding: 30px;
        top: 45%;
        /* Adjust position for better fit */
    }

    .hero-section {
        padding: 10px 20px 5px;
    }

    .header-logo img {
        width: 120px;
        /* Slightly smaller logo */
    }

    /* Fullscreen party modal for iPad portrait - completely fill viewport */
    #party-modal.modal {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #party-modal.modal.show {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    .party-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
    }

    /* Ensure modal header doesn't create space */
    .party-modal-header {
        flex-shrink: 0 !important;
        margin: 0 !important;
        padding-top: max(24px, env(safe-area-inset-top)) !important;
        padding-bottom: 24px !important;
        padding-left: 32px !important;
        padding-right: 32px !important;
    }

    /* Ensure modal body fills remaining space */
    .party-modal-body {
        flex: 1 !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 16px 24px !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
    }

    /* Ensure guests container fills space */
    .party-modal-body .guests-container {
        flex: 1 !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Center cards vertically for small groups (1-2 guests) */
    .party-modal-body .guests-grid.one-guest,
    .party-modal-body .guests-grid.two-guests {
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        flex: 0 0 auto !important;
    }

    /* Ensure guests grid doesn't have excessive bottom padding */
    .party-modal-body .guests-grid {
        padding-bottom: 20px !important;
        margin-bottom: 0 !important;
    }

    /* Reduce padding for 2-guest groups */
    .party-modal-body .guests-grid.two-guests {
        padding: 16px !important;
        padding-bottom: 20px !important;
        gap: 16px !important;
    }

    /* Guest names - allow wrapping to prevent overflow */
    .party-modal-body .guest-name {
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Adjust card sizing for small groups (2 guests) in portrait - make them much smaller */
    .party-modal-body .guests-grid.two-guests .guest-card {
        min-height: 100px !important;
        padding: 16px 24px !important;
    }

    /* Ensure checked-in cards maintain the same width for 2-guest groups */
    .party-modal-body .guests-grid.two-guests .guest-card.checked-in {
        width: auto !important;
        min-width: fit-content !important;
        max-width: none !important;
    }

    .party-modal-body .guests-grid.two-guests .guest-name {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }

    .party-modal-body .guests-grid.two-guests .guest-meta-badges {
        gap: 6px !important;
        margin-top: 4px !important;
    }

    .party-modal-body .guests-grid.two-guests .guest-code-badge,
    .party-modal-body .guests-grid.two-guests .guest-table-badge {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
    }

    /* Adjust card sizing for single guest in portrait - make it wider for long names */
    .party-modal-body .guests-grid.one-guest .guest-card {
        min-height: 80px !important;
        max-height: 120px !important;
        padding: 12px 20px !important;
        max-width: 380px !important;
        margin: 0 auto !important;
    }

    /* Ensure checked-in cards maintain the same width for 1-guest groups */
    .party-modal-body .guests-grid.one-guest .guest-card.checked-in {
        width: auto !important;
        min-width: fit-content !important;
        max-width: 380px !important;
    }

    .party-modal-body .guests-grid.one-guest .guest-name {
        /* font-size: 1.3rem !important; */
        margin-bottom: 8px !important;
    }

    .party-modal-body .guests-grid.one-guest .guest-meta-badges {
        gap: 6px !important;
        margin-top: 4px !important;
    }

    .party-modal-body .guests-grid.one-guest .guest-code-badge,
    .party-modal-body .guests-grid.one-guest .guest-table-badge {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
    }

    .party-modal-body .guests-grid.one-guest {
        padding: 16px !important;
        padding-bottom: 20px !important;
        max-width: 500px !important;
        margin: 0 auto !important;
    }

    /* Ensure party actions stay at bottom with proper spacing */
    .party-actions {
        flex-shrink: 0 !important;
        margin-top: auto !important;
        margin-bottom: 0 !important;
        padding: 20px 24px !important;
        padding-bottom: max(40px, env(safe-area-inset-bottom) + 40px) !important;
        background: var(--bg-card) !important;
        position: relative !important;
        z-index: 10 !important;
        border-top: 1px solid var(--border-color) !important;
    }
}

/* Mobile gauge visibility is controlled in the party modal header section */

/* Hide desktop search section on all screens - use new card UI */
.search-section {
    display: none !important;
}

/* Show logo on all screens with proper spacing */
.hero-section {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 5;
    padding: 15px 20px 10px;
}

.header-logo img {
    width: 120px;
    height: auto;
    margin: 10px 0 5px;
}

/* Mobile & iPad Responsive - Optimized for phones and tablets */
/* Target phones and iPad - Desktop starts at 1025px width */
@media (max-width: 1024px) {

    /* Mobile Initial View - Two Cards - Vertically centered */
    .mobile-initial-view {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 100%;
    }
}

/* Show mobile cards on all screens (including laptop) */
.mobile-initial-view {
    display: flex !important;
}

/* Larger cards for laptop screens - side by side */
@media (min-width: 1025px) {
    .mobile-cards-container {
        flex-direction: row;
        max-width: 1000px;
        gap: 28px;
    }

    .mobile-action-card {
        flex: 1;
        padding: 55px 45px;
        min-height: 200px;
        min-width: 450px;
    }

    .mobile-card-icon {
        width: 76px;
        height: 76px;
        font-size: 34px;
    }

    .mobile-action-card h3 {
        font-size: 1.85rem;
    }

    .mobile-action-card p {
        font-size: 1.1rem;
    }
}

/* Base styles for mobile cards - stacked vertically for small screens */
.mobile-cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}

/* Cards side by side for screens 865px and wider */
@media (min-width: 865px) {
    .mobile-cards-container {
        flex-direction: row;
        max-width: 900px;
        gap: 24px;
    }
}


/* Base styles for mobile action cards - apply to all screens */
.mobile-action-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    touch-action: manipulation;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mobile-action-card:active {
    transform: scale(0.97);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mobile-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), #333333);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-action-card h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.mobile-action-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
    opacity: 0.8;
}

/* Larger cards for screens 865px and wider */
@media (min-width: 865px) {
    .mobile-action-card {
        flex: 1;
        padding: 50px 40px;
        min-height: 180px;
        min-width: 400px;
    }

    .mobile-card-icon {
        width: 72px;
        height: 72px;
        font-size: 32px;
    }

    .mobile-action-card h3 {
        font-size: 1.75rem;
    }

    .mobile-action-card p {
        font-size: 1.05rem;
    }
}

/* Mobile Search Mode - Fade in from top - Positioned below logo */
/* Base styles for all screens */
.mobile-search-mode {
    display: none;
    position: fixed;
    top: calc(120px + env(safe-area-inset-top));
    left: 50%;
    transform: translate(-50%, -20px);
    width: 100%;
    max-width: 95%;
    min-width: 320px;
    padding: 20px;
    padding-bottom: 10px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 4;
    max-height: calc(100vh - 140px);
    overflow: visible;
}

.mobile-search-mode.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.mobile-search-mode.has-results {
    /* Keep search bar in same position when results appear */
    top: calc(120px + env(safe-area-inset-top));
}

.mobile-search-container {
    width: 100%;
    max-width: 100%;
}

.mobile-search-form {
    position: relative;
}

.mobile-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-search-input-container::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.mobile-search-input {
    width: 100%;
    padding: 20px 56px 20px 56px;
    font-size: 19px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    color: var(--text-dark);
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    min-height: 56px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

.mobile-search-clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
    z-index: 2;
}

.mobile-search-clear-btn.visible {
    display: flex;
}

.mobile-search-clear-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.mobile-search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    -webkit-overflow-scrolling: touch;
}

.mobile-search-dropdown.has-results {
    display: block;
}

.mobile-search-dropdown-item {
    padding: 20px 24px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    font-size: 19px;
}

.mobile-search-dropdown-item:first-child {
    border-radius: 16px 16px 0 0;
}

.mobile-search-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
}

.mobile-search-dropdown-item:hover,
.mobile-search-dropdown-item.highlighted {
    background: rgba(0, 0, 0, 0.05);
}

/* Card fade animations - apply to all screens */
.mobile-action-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-action-card.fade-out-up {
    opacity: 0 !important;
    transform: translateY(-30px) !important;
    pointer-events: none !important;
}

.mobile-action-card.fade-out-down {
    opacity: 0 !important;
    transform: translateY(30px) !important;
    pointer-events: none !important;
}

.mobile-action-card.fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* Larger screens: wider search bar and cards */
@media (min-width: 768px) {
    .mobile-search-mode {
        max-width: 900px;
        min-width: 600px;
        width: auto;
        padding: 20px;
        padding-bottom: 10px;
        max-height: calc(100vh - 120px);
    }

    .mobile-search-container {
        max-width: 100%;
    }

    .mobile-search-dropdown {
        max-height: calc(100vh - 280px);
    }
}

/* Mobile-specific adjustments */
@media (max-width: 1024px) {

    /* Safe area support for notched devices */
    .checkin-container {
        padding: 10px 8px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(80px, env(safe-area-inset-bottom) + 70px);
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        gap: 15px;
        min-height: 100vh;
    }

    .couple-names {
        font-size: 1.8rem;
    }

    .search-input {
        padding: 18px 36px 18px 48px;
        font-size: 17px;
        /* Ensure touch targets are large enough */
        min-height: 44px;
    }

    /* Adjust search icon position on mobile */
    .search-input-container::before {
        left: 15px;
        font-size: 14px;
        transform: translateY(-95%);
    }

    /* Shorter placeholder on mobile */
    .search-input::placeholder {
        font-size: 17px;
    }

    .qr-scan-card {
        padding: 20px;
    }

    .qr-scan-content h3 {
        font-size: 1.3rem;
    }

    .qr-scan-content p {
        font-size: 0.9rem;
    }

    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-button,
    .qr-button {
        width: 100%;
        justify-content: center;
        /* Better touch targets */
        min-height: 48px;
        padding: 16px 24px;
        font-size: 1rem;
    }

    .guests-grid,
    .guests-list {
        gap: 10px;
        padding: 8px 0;
    }

    .guest-item {
        padding: 16px 18px;
        border-radius: 10px;
        min-height: 72px;
    }

    .guest-name {
        font-size: 1rem;
    }

    .guest-status {
        font-size: 0.85rem;
    }

    .party-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline {
        width: 100%;
        justify-content: center;
        /* Better touch targets */
        min-height: 48px;
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Improved modal handling for mobile - Full screen optimized design */
    .modal.show {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    /* QR Modal - Minimal white space, centered on mobile */
    #qr-modal.modal.show {
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .qr-modal-content {
        padding: 12px 8px 8px 8px !important;
        border-radius: 12px;
        max-width: calc(100vw - 24px);
        width: calc(100vw - 24px);
        margin: 0 auto;
    }

    .qr-reader-container {
        margin: 0;
    }

    .qr-reader {
        border-radius: 8px;
    }

    .qr-instruction-text {
        margin: 6px 0 0 !important;
        font-size: 0.8rem;
        padding: 0;
        line-height: 1.3;
    }

    .party-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .party-modal-header {
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top) + 8px);
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 60px;
    }

    .party-modal-header .close-modal {
        top: max(12px, env(safe-area-inset-top) + 8px);
        right: 16px;
        transform: none;
    }

    .party-modal-header .party-header {
        margin: 0;
        padding: 0;
        display: none;
    }

    .party-modal-header .party-name {
        display: none !important;
    }

    .party-modal-header .party-info {
        display: none !important;
    }

    .party-modal-header .checkin-progress {
        display: none !important;
    }

    /* Mobile Check-in Gauge - Left side, vertically centered in header */
    .mobile-checkin-gauge {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        left: 20px;
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
        opacity: 0.6;
        z-index: 1;
    }

    .gauge-svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .gauge-background {
        fill: none;
        stroke: rgba(0, 0, 0, 0.08);
        stroke-width: 4;
    }

    .gauge-progress {
        fill: none;
        stroke: var(--success-color);
        stroke-width: 4;
        stroke-linecap: round;
        stroke-dasharray: 283;
        stroke-dashoffset: 283;
        transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
    }

    .party-modal-content.in-progress .gauge-progress {
        stroke: #f59e0b;
    }

    .party-modal-content.complete .gauge-progress {
        stroke: var(--success-color);
    }

    .gauge-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 0.65rem;
        font-weight: 700;
        color: var(--text-dark);
        transition: color 0.3s ease;
        opacity: 0.9;
    }

    .party-modal-content.in-progress .gauge-text {
        color: #f59e0b;
    }

    .party-modal-content.complete .gauge-text {
        color: var(--success-color);
    }

    /* Realign badges for mobile - left aligned below name */
    .party-modal-body .guest-meta-badges {
        margin-top: 0;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
        border-radius: 10px;
        font-weight: 600;
    }

    .party-modal-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        /* Better scroll on mobile */
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom) + 12px);
        /* Ensure flex children can shrink */
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .party-modal-body .guests-container {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        justify-content: center;
        align-items: center;
    }

    .party-modal-body .guests-grid {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        grid-template-columns: 1fr;
        /* Single column - full width */
        gap: 10px;
        padding: 0 8px;
        width: 100%;
        max-width: 100%;
    }

    /* Center cards vertically for small groups (1-2 guests) on mobile */
    .party-modal-body .guests-grid.one-guest,
    .party-modal-body .guests-grid.two-guests {
        flex: 0 0 auto;
        justify-content: center;
        align-items: center;
        margin: auto 0;
    }

    .party-modal-body .guest-card {
        padding: 16px 20px;
        min-height: 64px;
        border-radius: 0;
        margin: 0;
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        box-sizing: border-box;
        touch-action: manipulation;
        background: var(--bg-card);
        border: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
        transition: background 0.15s ease;
        transform: none !important;
        animation: none !important;
    }

    .party-modal-body .guest-card:active {
        background: var(--bg-hover);
        transform: none !important;
    }

    .party-modal-body .guest-card.tapping {
        animation: none !important;
        transform: none !important;
    }

    .party-modal-body .guest-name {
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    /* Hide badges on mobile phones only (not iPad) - show as simple text instead */
    .party-modal-body .guest-meta-badges {
        display: none !important;
    }

    /* Show code and table as simple text on mobile */
    .party-modal-body .guest-meta-text {
        display: block;
        font-size: 0.8rem;
        color: var(--text-light);
        margin-top: 2px;
        font-weight: 400;
    }

    .party-modal-body .guest-code-text,
    .party-modal-body .guest-table-text {
        font-size: 0.8rem;
        color: var(--text-light);
        font-weight: 400;
    }

    .party-modal-body .guest-code-text::after {
        content: ' • ';
        margin: 0 4px;
        color: var(--text-light);
        opacity: 0.5;
    }

    .party-modal-body .guest-details {
        display: none;
    }

    /* Mobile checked-in style - simple and clean, no movement */
    .party-modal-body .guest-card.checked-in {
        background: rgba(16, 185, 129, 0.15) !important;
        border-bottom-color: #10b981 !important;
        border-bottom-width: 1px !important;
        /* Keep same width to prevent movement */
        padding: 16px 20px !important;
        /* Ensure padding stays exactly the same */
        margin: 0 !important;
        /* Ensure margin stays exactly the same */
        width: calc(100% - 16px) !important;
        /* Ensure width stays exactly the same */
        max-width: calc(100% - 16px) !important;
        /* Ensure max-width stays exactly the same */
        transform: none !important;
        /* No transforms */
        animation: none !important;
        /* No animations */
        box-sizing: border-box !important;
        /* Consistent box-sizing */
    }

    .party-modal-body .party-actions {
        flex-shrink: 0;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
        gap: 12px;
        flex-direction: column;
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        padding-bottom: max(16px, env(safe-area-inset-bottom) + 16px);
        z-index: 5;
    }

    .party-modal-body .btn-checkin-all,
    .party-modal-body .btn-submit {
        width: 100%;
        min-height: 52px;
        padding: 14px 20px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 12px;
        justify-content: center;
    }

    /* Improve dropdown on mobile */
    .search-dropdown {
        max-height: 50vh;
        border-radius: 12px;
        /* Better scroll on mobile */
        -webkit-overflow-scrolling: touch;
    }

    .search-dropdown-item {
        padding: 16px;
        min-height: 60px;
    }

    /* Better spacing for touch interactions */
    .qr-scan-card {
        padding: 24px;
        min-height: 120px;
    }

    .party-info {
        flex-direction: column;
        gap: 10px;
    }

    .guest-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .guest-actions {
        justify-content: space-between;
    }

    /* Optimize for small screens */
    .header-logo img {
        width: 120px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .search-section {
        padding: 20px 15px;
        padding-top: max(20px, env(safe-area-inset-top));
        max-width: 98%;
        /* Proper vertical centering - adjusted to account for status badge */
        position: absolute;
        top: calc(50% - 25px);
        left: 50%;
        transform: translate(-50%, -50%);
        /* Smooth scroll when keyboard appears */
        transition: transform 0.3s ease;
    }

    .search-input {
        padding: 16px 32px 16px 44px;
        font-size: 16px;
        min-height: 48px;
    }

    /* Even better touch targets for small screens */
    .search-button,
    .qr-button {
        min-height: 52px;
        padding: 18px 24px;
        font-size: 1.05rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline {
        min-height: 52px;
        padding: 16px 20px;
    }

    /* Full screen modal for small screens */
    .party-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .party-modal-header {
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .party-modal-body {
        max-height: calc(95vh - 140px);
        overflow-y: auto;
        overflow-x: hidden;
        /* Better scroll on mobile */
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        /* Ensure flex children can shrink */
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .party-modal-body .guests-container {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .party-modal-body .guests-grid {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        grid-template-columns: 1fr;
        /* Single column - full width */
        padding: 12px;
        padding-right: 20px;
        /* Space for scrollbar on far right */
        width: 100%;
        max-width: 100%;
    }

    .party-modal-body .party-actions {
        flex-shrink: 0;
        margin-top: 12px;
        padding-top: 12px;
    }

    .search-dropdown {
        max-height: 60vh;
    }

    /* Adjust search icon position on small mobile */
    .search-input-container::before {
        left: 13px;
        font-size: 13px;
        transform: translateY(-95%);
    }

    /* Shorter placeholder on small mobile */
    .search-input::placeholder {
        font-size: 16px;
    }

    .qr-scan-card {
        padding: 15px;
    }

    .qr-scan-content h3 {
        font-size: 1.2rem;
    }

    .header-logo img {
        width: 100px;
    }

    .couple-names {
        font-size: 1.5rem;
    }
}

/* Landscape Orientation Fixes for QR Scanner */
@media (max-width: 768px) and (orientation: landscape) {
    .modal.show {
        padding: 10px;
        align-items: flex-start;
        padding-top: 5vh;
    }

    .modal-content {
        max-height: 90vh;
        width: 100%;
        max-width: 90vw;
    }

    .qr-reader {
        max-width: 60vh;
        width: 60vh;
        height: 60vh;
        aspect-ratio: 1;
        min-height: 250px;
        max-height: 60vh;
    }

    .modal-body {
        padding: 15px;
    }

    .qr-instructions {
        font-size: 0.9rem;
        margin-top: 10px;
    }
}

/* iPad Landscape Mode - QR Scanner Orientation Fix */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

    /* QR Modal adjustments for landscape */
    #qr-modal.modal.show {
        padding: 15px;
        align-items: center;
        justify-content: center;
    }

    #qr-modal .modal-content {
        max-width: 70vh;
        width: 70vh;
        max-height: 85vh;
    }

    #qr-modal .modal-body {
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Optimize QR reader for landscape orientation */
    #qr-modal .qr-reader {
        max-width: 65vh;
        width: 65vh;
        height: 65vh;
        aspect-ratio: 1;
        min-height: 300px;
        max-height: 65vh;
        position: relative;
        overflow: hidden;
    }

    /* Ensure video element fills the container properly in landscape */
    #qr-modal .qr-reader video {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        transform: none;
        position: relative;
    }

    /* Ensure canvas element is properly oriented */
    #qr-modal .qr-reader canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        transform: none;
        position: absolute;
        top: 0;
        left: 0;
    }

    #qr-modal .qr-instructions {
        font-size: 0.95rem;
        margin-top: 12px;
    }
}

/* Clean Party Modal - Fullscreen on all screens */
.party-modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none;
    margin: 0 !important;
    /* Ensure content sizes properly */
    min-height: 0;
}

.party-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
    min-height: 60px;
}

/* Ensure header elements are vertically centered on larger screens */
@media (min-width: 768px) {
    .party-modal-header {
        align-items: center !important;
    }


    .party-modal-header .close-modal {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
}

.party-modal-header .party-header {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
    border: none;
}

.party-modal-header .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    z-index: 11;
    font-size: 0.9rem;
    min-width: 36px;
    min-height: 36px;
}

/* Ensure close button is vertically centered on larger screens */
@media (min-width: 768px) {
    .party-modal-header .close-modal {
        top: 50% !important;
        right: 20px !important;
        transform: translateY(-50%) !important;
    }
}

.party-modal-header .close-modal:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--border-color);
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.party-modal-body {
    flex: 1;
    padding: 16px 24px;
    padding-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    /* Ensure scrolling works on mobile */
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Modern guest display styles */
.party-modal-body .guests-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(65, 24, 26, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-height: 0;
    position: relative;
    padding: 12px;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 12px;
    gap: 10px;
}

.party-modal-body .guests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Multiple columns for desktop/iPad */
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: 20px;
    /* Prevent cards from overlapping party-actions */
    margin: 0 auto;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Larger screens: reduce gaps and padding for better fit */
@media (min-width: 768px) {
    .party-modal-body .guests-grid {
        gap: 10px;
        padding: 20px;
        padding-bottom: 20px;
    }

    .party-modal-body .guests-grid.large-group {
        gap: 8px;
    }
}

/* Larger screens: 2 columns layout by default, 3 columns for large groups (>6) */
@media (min-width: 768px) {
    .party-modal-body .guests-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }

    /* 3 columns for groups larger than 6 */
    .party-modal-body .guests-grid.large-group {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }
}

/* Center card when there is exactly 1 guest */
.party-modal-body .guests-grid.one-guest {
    grid-template-columns: 1fr;
    justify-content: center;
    align-items: center;
    max-width: 380px;
    width: auto;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
    justify-self: center;
    align-self: center;
}

/* iPad/Desktop: Solo groups styling and modal adjustments */
@media (min-width: 768px) {

    /* Hide old party header elements on larger screens - use gauge instead */
    .party-modal-header .party-header {
        display: none !important;
    }

    .party-modal-header .party-name {
        display: none !important;
    }

    .party-modal-header .party-info {
        display: none !important;
    }

    .party-modal-header .checkin-progress {
        display: none !important;
    }

    /* Show gauge on larger screens (left side, vertically centered) */
    .party-modal-header .mobile-checkin-gauge {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        top: 50% !important;
        left: 20px !important;
        transform: translateY(-50%) !important;
        width: 50px !important;
        height: 50px !important;
        opacity: 1 !important;
        z-index: 1 !important;
    }

    .party-modal-header .gauge-svg {
        width: 100% !important;
        height: 100% !important;
        transform: rotate(-90deg) !important;
    }

    .party-modal-header .gauge-background {
        fill: none !important;
        stroke: rgba(0, 0, 0, 0.08) !important;
        stroke-width: 4 !important;
    }

    .party-modal-header .gauge-progress {
        fill: none !important;
        stroke: var(--success-color) !important;
        stroke-width: 4 !important;
        stroke-linecap: round !important;
        stroke-dasharray: 283 !important;
        /* Don't set stroke-dashoffset here - let JavaScript control it dynamically */
        transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease !important;
    }

    .party-modal-content.in-progress .party-modal-header .gauge-progress {
        stroke: #f59e0b !important;
    }

    .party-modal-content.complete .party-modal-header .gauge-progress {
        stroke: var(--success-color) !important;
    }

    .party-modal-header .gauge-text {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        font-size: 0.65rem !important;
        font-weight: 700 !important;
        color: var(--text-dark) !important;
        z-index: 2 !important;
        pointer-events: none !important;
    }

    .party-modal-content.in-progress .party-modal-header .gauge-text {
        color: #f59e0b !important;
    }

    .party-modal-content.complete .party-modal-header .gauge-text {
        color: var(--success-color) !important;
    }

    /* Remove outer card styling on iPad and larger screens */
    .party-modal-body .guests-container {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        backdrop-filter: none !important;
        padding: 0 !important;
    }

    /* Prevent name wrapping for solo groups on iPad/Desktop */
    .party-modal-body .guests-grid.one-guest .guest-name {
        word-wrap: normal;
        overflow-wrap: normal;
        hyphens: none;
        white-space: normal;
        /* font-size: 1.4rem !important; */
    }

    /* Ensure solo guest cards have enough width to prevent wrapping */
    .party-modal-body .guests-grid.one-guest .guest-card {
        min-width: 280px;
    }

    /* For solo groups, keep everything exactly the same when checked in - only background color changes */
    .party-modal-body .guests-grid.one-guest .guest-card.checked-in {
        /* Only change background and border color, nothing else */
        background: rgba(16, 185, 129, 0.15) !important;
        border-color: #10b981 !important;
        /* Reset any other properties that might change */
        border-width: 1.5px !important;
        border-radius: 12px !important;
        padding: 16px 20px !important;
        margin: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
        /* Ensure no transforms or animations persist */
        transform: none !important;
        animation: none !important;
        /* Ensure width stays exactly the same */
        width: auto !important;
        min-width: fit-content !important;
        max-width: none !important;
        width: 100% !important;
        min-width: 280px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Prevent animation from affecting solo groups */
    .party-modal-body .guests-grid.one-guest .guest-card.just-checked-in {
        animation: none !important;
        transform: none !important;
    }

    /* Prevent tapping animation from affecting solo groups */
    .party-modal-body .guests-grid.one-guest .guest-card.tapping {
        animation: none !important;
        transform: none !important;
    }



    /* Show badges on iPad and larger screens */
    .party-modal-body .guest-meta-badges {
        display: flex !important;
        visibility: visible !important;
    }

    .party-modal-body .guest-meta-text {
        display: none !important;
    }

    /* Ensure table badges are visible */
    .party-modal-body .guest-table-badge {
        display: inline-flex !important;
        visibility: visible !important;
    }

    /* Fullscreen modal for iPad/Desktop */
    .party-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    /* Ensure modal body fits all cards without scrolling */
    .party-modal-body {
        overflow: visible !important;
        max-height: none !important;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .party-modal-body .guests-container {
        overflow: visible !important;
        flex: 1;
        min-height: 0;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100%;
    }

    .party-modal-body .guests-grid {
        overflow: visible !important;
        max-height: none !important;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 24px !important;
        padding-bottom: 100px !important;
        /* Extra bottom padding to prevent button cutoff */
        margin: 0 auto !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        max-width: 700px !important;
        box-sizing: border-box !important;
    }

    /* 3 columns for large groups - full width */
    .party-modal-body .guests-grid.large-group {
        max-width: 100% !important;
    }

    /* For one-guest, ensure perfect centering by removing side padding from grid */
    .party-modal-body .guests-grid.one-guest {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 32px !important;
        padding-bottom: 100px !important;
    }

    /* Add padding to the card instead for one-guest */
    .party-modal-body .guests-grid.one-guest .guest-card {
        margin-left: 32px !important;
        margin-right: 32px !important;
    }

    /* Ensure one-guest grid is perfectly centered - override any conflicting styles */
    .party-modal-body .guests-grid.one-guest {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 380px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 32px !important;
        padding-left: 32px !important;
        padding-right: 32px !important;
        padding-top: 32px !important;
        padding-bottom: 100px !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateX(0) !important;
    }

    /* 3 columns for groups larger than 6 */
    .party-modal-body .guests-grid.large-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    /* Ensure guest cards and names fit properly - constrain to grid column, allow wrapping */
    .party-modal-body .guest-card {
        min-height: 150px;
        padding: 32px 40px;
        overflow: visible;
        border-radius: 18px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure checked-in cards maintain the same width */
    .party-modal-body .guest-card.checked-in {
        width: 100% !important;
        max-width: 100% !important;
    }

    .party-modal-body .guest-info {
        width: 100%;
        min-width: 0;
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }

    .party-modal-body .guest-name {
        font-size: clamp(1rem, 1.3rem, 1.4rem);
        font-weight: 400;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: break-word;
        word-wrap: break-word;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: 8px;
        hyphens: none;
    }

    .party-modal-body .guest-card-content {
        width: 100%;
        min-width: 0;
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }

    .party-modal-body .guest-card-header {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    /* Solo guest - center it, wider for long names */
    .party-modal-body .guests-grid.one-guest {
        grid-template-columns: 1fr !important;
        max-width: 380px;
        width: 100%;
        margin: 0 auto;
        padding: 32px !important;
        padding-left: 32px !important;
        padding-right: 32px !important;
        padding-bottom: 100px !important;
        flex: 0 0 auto;
        justify-self: center;
        align-self: center;
        box-sizing: border-box;
    }

    /* Two guests - show 2 cards, center vertically, wider for long names */
    .party-modal-body .guests-grid.two-guests {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
        margin: 0 auto;
        flex: 0 0 auto;
        justify-self: center;
        align-self: center;
    }
}

/* Laptop and larger screens (1025px+) - fullscreen */
@media (min-width: 1025px) {
    .party-modal-content {
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    /* Ensure badges match portrait/base view */
    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
        border-radius: 12px !important;
    }

    /* Ensure modal body has no side padding that would offset centering */
    .party-modal-body {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .party-modal-body .guests-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .party-modal-body .guests-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 28px !important;
        padding: 24px !important;
        padding-bottom: 48px !important;
        /* Extra bottom padding to prevent overlap */
        overflow: visible !important;
        max-height: none !important;
        margin: 0 auto !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        max-width: 700px !important;
        box-sizing: border-box !important;
    }

    /* 3 columns for large groups - full width */
    .party-modal-body .guests-grid.large-group {
        max-width: 100% !important;
    }

    /* Center cards vertically for small groups (1-2 guests) on large screens */
    .party-modal-body .guests-grid.one-guest,
    .party-modal-body .guests-grid.two-guests {
        flex: 0 0 auto !important;
        margin: 0 auto !important;
        justify-self: center !important;
        align-self: center !important;
    }

    /* Ensure one-guest is perfectly centered on large screens - equal spacing from container edges */
    .party-modal-body .guests-grid.one-guest {
        grid-template-columns: 1fr !important;
        max-width: 380px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        padding-top: 36px !important;
        padding-bottom: 48px !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateX(0) !important;
    }

    /* Ensure card fills the grid column - this will align with centered buttons */
    .party-modal-body .guests-grid.one-guest .guest-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ensure party actions have enough bottom padding on large screens and are centered */
    .party-modal-body .party-actions {
        padding-bottom: max(40px, env(safe-area-inset-bottom) + 40px) !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* 3 columns for groups larger than 6 */
    .party-modal-body .guests-grid.large-group {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 28px !important;
    }

    .party-modal-body .guest-card {
        padding: 40px 48px !important;
        min-height: 170px !important;
        border-radius: 20px !important;
        overflow: visible !important;
    }

    .party-modal-body .guest-name {
        font-size: clamp(1.2rem, 1.4rem, 1.5rem) !important;
        font-weight: 400 !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        hyphens: none !important;
    }


    .party-modal-body .guest-info {
        gap: 4px !important;
    }

    .party-modal-body .guest-meta-badges {
        gap: 5px !important;
        margin-top: 4px !important;
        display: flex !important;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.9rem !important;
        padding: 7px 14px !important;
        border-radius: 12px !important;
    }

    /* Ensure modal body doesn't scroll */
    .party-modal-body {
        overflow: visible !important;
        max-height: none !important;
    }

    .party-modal-body .guests-container {
        overflow: visible !important;
        max-height: none !important;
    }
}

/* Taller screens - optimize vertical space usage */
@media (min-width: 768px) and (min-height: 900px) {
    .party-modal-content {
        max-height: 90vh !important;
    }

    .party-modal-body .guests-grid {
        gap: 14px !important;
        padding: 20px !important;
    }

    .party-modal-body .guests-grid.large-group {
        gap: 12px !important;
    }

    .party-modal-body .guest-card {
        padding: 14px 16px !important;
    }
}

/* Very tall screens - tighter spacing */
@media (min-width: 768px) and (min-height: 1200px) {
    .party-modal-content {
        max-height: 85vh !important;
    }

    .party-modal-body .guests-grid {
        gap: 12px !important;
        padding: 18px !important;
    }

    .party-modal-body .guests-grid.large-group {
        gap: 10px !important;
    }

    .party-modal-body .guest-card {
        padding: 12px 14px !important;
    }
}

/* Center cards when there are exactly 2 guests */
.party-modal-body .guests-grid.two-guests {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

/* Consistent styling for all groups - removed conditional scrollable class */
/* Scrolling is handled by base overflow-y: auto property */

/* Mobile grid - full width single column with scrollbar on far right */
@media (max-width: 768px) {
    .party-modal-body .guests-grid {
        grid-template-columns: 1fr !important;
        /* Force single column */
        padding: 0 !important;
        padding-right: 20px !important;
        /* Space for scrollbar on far right */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* On mobile, one or two guests should still be centered but in a single column */
    .party-modal-body .guests-grid.one-guest,
    .party-modal-body .guests-grid.two-guests {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }

    /* Mobile solo group - ensure proper formatting */
    .party-modal-body .guests-grid.one-guest {
        justify-content: center;
        align-items: center;
    }

    .party-modal-body .guests-grid.one-guest .guest-card {
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
    }

    /* For solo groups on mobile, keep everything exactly the same when checked in - only background color changes */
    .party-modal-body .guests-grid.one-guest .guest-card.checked-in {
        /* Only change background and border color, nothing else */
        background: rgba(16, 185, 129, 0.15) !important;
        border-bottom-color: #10b981 !important;
        border-bottom-width: 1px !important;
        /* Keep same width to prevent movement */
        /* Reset any other properties that might change */
        padding: 16px 20px !important;
        margin: 0 !important;
        width: calc(100% - 16px) !important;
        /* Ensure width stays exactly the same */
        max-width: calc(100% - 16px) !important;
        /* Ensure max-width stays exactly the same */
        /* Ensure no transforms or animations persist */
        transform: none !important;
        animation: none !important;
        box-sizing: border-box !important;
        /* Consistent box-sizing */
    }

    /* Prevent animation from affecting solo groups on mobile */
    .party-modal-body .guests-grid.one-guest .guest-card.just-checked-in {
        animation: none !important;
        transform: none !important;
    }

    /* Prevent tapping animation from affecting solo groups on mobile */
    .party-modal-body .guests-grid.one-guest .guest-card.tapping {
        animation: none !important;
        transform: none !important;
    }



    .party-modal-body .guest-card {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .party-modal-body .guests-grid {
        grid-template-columns: 1fr !important;
        /* Force single column */
        padding: 0 !important;
        padding-right: 20px !important;
        /* Space for scrollbar on far right */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* On small mobile, one or two guests should still be centered but in a single column */
    .party-modal-body .guests-grid.one-guest,
    .party-modal-body .guests-grid.two-guests {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }

    .party-modal-body .guest-card {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Consistent scrollbar styling for all groups */
.party-modal-body .guests-grid::-webkit-scrollbar {
    width: 4px;
}

.party-modal-body .guests-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.party-modal-body .guests-grid::-webkit-scrollbar-thumb {
    background: rgba(65, 24, 26, 0.2);
    border-radius: 2px;
}

.party-modal-body .guests-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(65, 24, 26, 0.3);
}

/* Guest Card - Matching Admin Table Style */
.party-modal-body .guest-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    min-height: 80px;
    margin: 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    max-height: none;
    /* Improve touch response */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.party-modal-body .guest-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.party-modal-body .guest-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.1s ease;
}

/* Desktop/iPad only - no transform on mobile */
@media (min-width: 768px) {
    .party-modal-body .guest-card:active {
        /* Disable transform - only background color should change */
        transform: none !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }
}

/* Modern Touch Feedback */
@keyframes cardTap {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.96);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.party-modal-body .guest-card.tapping {
    /* Disable animation - only background color should change */
    animation: none !important;
    transform: none !important;
}

.party-modal-body .guest-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    pointer-events: none;
}

.party-modal-body .guest-card:active::after {
    width: 100px;
    height: 100px;
}

/* Loading state for guest cards */
.party-modal-body .guest-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.party-modal-body .guest-card.loading .status-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.party-modal-body .guest-card:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 24, 26, 0.1);
}

.party-modal-body .guest-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(65, 24, 26, 0.1);
}



.party-modal-body .guest-card.checked-in {
    border-bottom-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

/* Success animation only for newly checked-in cards */
.party-modal-body .guest-card.just-checked-in {
    /* Disable animation - only background color should change */
    animation: none !important;
    transform: none !important;
}

/* Success animation for check-in */
@keyframes checkinSuccess {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 0 0 3px rgba(16, 185, 129, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
    }
}

.party-modal-body .guest-card.checked-in .guest-card-content {
    /* NO STYLES - inherit everything from base state. Only card background color changes. */
    background: transparent;
    border-radius: 0;
    margin: 0;
    padding: 0;
}

.party-modal-body .guest-card.checked-in:hover {
    border-color: #059669;
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.party-modal-body .guest-card.checked-in:hover .guest-card-content {
    background: transparent;
}

/* Guest Card Content - Matching Admin Table Style */
.party-modal-body .guest-card-content {
    padding: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    width: 100%;
    flex: 1;
    margin: 0;
}

.party-modal-body .guest-card-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: auto;
    position: relative;
    margin: 0;
}

.party-modal-body .guest-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    text-align: center;
    width: 100%;
    overflow: visible;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    max-width: 100%;
}

/* Reduce gap on larger screens for tighter layout */
@media (min-width: 768px) {
    .party-modal-body .guest-info {
        gap: 4px;
    }
}

.party-modal-body .guest-name {
    font-size: clamp(0.85rem, 1.1rem, 1.15rem);
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.4;
    text-align: center;
    margin: 0;
    letter-spacing: -0.01em;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    hyphens: none;
}

/* Keep names the same when checked in - prevent wrapping but don't truncate */
.party-modal-body .guest-card.checked-in {
    /* Ensure card width doesn't change - preserve original width */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}


/* Override base font-weight for all larger screens */
@media (min-width: 768px) {
    .party-modal-body .guest-name {
        font-weight: 400;
    }
}

/* Larger screens: Single line, no truncation */
@media (min-width: 768px) {
    .party-modal-body .guest-name {
        font-size: 1rem;
        font-weight: 400;
        white-space: nowrap;
        overflow: visible;
        width: auto;
        max-width: none;
    }



}

/* Ensure laptop gets the correct font weight - override any conflicting rules */
@media (min-width: 1025px) {
    .party-modal-body .guest-name {
        font-weight: 400 !important;
    }
}

.party-modal-body .guest-meta-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.party-modal-body .guest-code-badge,
.party-modal-body .guest-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 6px 12px;
    border-radius: 12px;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

/* Badge size on larger screens */
@media (min-width: 768px) {
    .party-modal-body .guest-meta-badges {
        gap: 5px;
        margin-top: 4px;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

.party-modal-body .guest-code-badge {
    background: rgba(107, 114, 128, 0.15);
    color: #374151;
    border: 1px solid rgba(107, 114, 128, 0.25);
    font-weight: 700;
}

.party-modal-body .guest-table-badge {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

@media (max-width: 768px) {
    .party-modal-body .guest-info {
        gap: 5px;
        padding: 3px 0;
    }

    .party-modal-body .guest-name {
        font-size: 1.05rem;
    }

    .party-modal-body .guest-meta-badges {
        gap: 5px;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .party-modal-body .guest-info {
        gap: 4px;
        padding: 2px 0;
    }

    .party-modal-body .guest-name {
        font-size: 1rem;
    }

    .party-modal-body .guest-meta-badges {
        gap: 4px;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.6rem;
        padding: 3px 7px;
    }
}



.party-modal-body .guest-details {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
    text-align: center;
    margin: 2px auto 0;
    opacity: 0.85;
    font-style: italic;
    width: 100%;
    box-sizing: border-box;
}

.party-modal-body .guest-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
}

/* Hide status badge - use card color instead */
.party-modal-body .status-badge {
    display: none;
}

/* Text-based status indicators - no icons needed */

.party-modal-body .party-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-top: 1px solid rgba(65, 24, 26, 0.1);
    flex-shrink: 0;
    margin-top: 0;
    margin-bottom: 0;
    background: var(--bg-card);
    position: relative;
    z-index: 10;
}

.party-modal-body .btn-checkin-all {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: var(--text-dark);
    border: 1px solid rgba(65, 24, 26, 0.15);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-width: 140px;
    user-select: none;
}

.party-modal-body .btn-checkin-all:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.95));
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(65, 24, 26, 0.25);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: var(--text-dark);
}

.party-modal-body .btn-checkin-all:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.1s ease;
}

.party-modal-body .btn-checkin-all:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 0 0 3px rgba(65, 24, 26, 0.1);
}

.party-modal-body .btn-checkin-all:focus-visible {
    outline: none;
}

.party-modal-body .btn-checkin-all i {
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.party-modal-body .btn-checkin-all:hover i {
    transform: scale(1.1);
    color: var(--primary-color);
}

.party-modal-body .btn-checkin-all.processing i {
    animation: spin-smooth 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #ff8c00 !important;
    filter: drop-shadow(0 1px 3px rgba(255, 140, 0, 0.3));
}

.party-modal-body .btn-checkin-all:disabled {
    background: linear-gradient(135deg, rgba(245, 245, 245, 0.8), rgba(240, 240, 240, 0.6));
    color: var(--text-muted);
    border-color: rgba(65, 24, 26, 0.1);
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.party-modal-body .btn-checkin-all:disabled:hover {
    transform: none;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.party-modal-body .btn-checkin-all.processing {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.1), rgba(255, 165, 0, 0.08));
    border-color: rgba(255, 140, 0, 0.3);
    color: #ff8c00;
    animation: processing-pulse 1.5s ease-in-out infinite;
}

/* Spinning animation for loading state */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes processing-pulse {

    0%,
    100% {
        background: linear-gradient(135deg, rgba(255, 140, 0, 0.1), rgba(255, 165, 0, 0.08));
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }

    50% {
        background: linear-gradient(135deg, rgba(255, 140, 0, 0.15), rgba(255, 165, 0, 0.12));
        box-shadow: 0 2px 8px rgba(255, 140, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
}

.party-modal-body .btn-checkin-all i.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Modern Submit button styling */
.party-modal-body .btn-submit {
    background: #16a34a;
    color: #ffffff;
    border: 2px solid transparent;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        0 4px 12px rgba(22, 163, 74, 0.2),
        0 2px 4px rgba(22, 163, 74, 0.1);
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.party-modal-body .btn-submit:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(22, 163, 74, 0.3),
        0 4px 8px rgba(22, 163, 74, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.party-modal-body .btn-submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(22, 163, 74, 0.2),
        0 1px 4px rgba(22, 163, 74, 0.15);
    transition: all 0.1s ease;
}

.party-modal-body .btn-submit:focus {
    outline: none;
    box-shadow:
        0 4px 12px rgba(22, 163, 74, 0.2),
        0 2px 4px rgba(22, 163, 74, 0.1),
        0 0 0 3px rgba(22, 163, 74, 0.2);
}

.party-modal-body .btn-submit:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

.party-modal-body .btn-submit:disabled {
    background: #9ca3af;
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.party-modal-body .btn-submit:disabled:hover {
    transform: none;
    box-shadow: none;
}

.party-modal-body .btn-submit i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.party-modal-body .btn-submit:hover i {
    transform: scale(1.1);
}

/* Modern confirmation code and party code styling */
.party-modal-header .party-info {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    flex-direction: row;
    margin-bottom: 12px;
}

.party-modal-header .confirmation-code,
.party-modal-header .party-code {
    background: #000000 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    color: #ffffff !important;
    border: none !important;
    backdrop-filter: blur(10px);
    display: inline-block;
    width: auto;
    max-width: fit-content;
    text-align: center;
    height: auto;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
}

/* Progress styles in modal */
.party-modal-header .checkin-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px auto;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(65, 24, 26, 0.1);
    width: fit-content;
    max-width: 200px;
}

.party-modal-header .progress-bar {
    width: 80px;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

.party-modal-header .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

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

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

    100% {
        transform: translateX(100%);
    }
}

.party-modal-header .progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Modern pagination controls for modal */
.party-modal-body .pagination-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(65, 24, 26, 0.1);
    backdrop-filter: blur(10px);
    gap: 15px;
}

.party-modal-body .pagination-info {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dark);
}

.party-modal-body .pagination-buttons {
    display: flex;
    gap: 6px;
}

.party-modal-body .pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(65, 24, 26, 0.15);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.party-modal-body .pagination-btn i {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.party-modal-body .pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(65, 24, 26, 0.25);
}

.party-modal-body .pagination-btn:hover:not(:disabled) i {
    color: white;
}

.party-modal-body .pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Responsive modal styles - Mobile phones only (not tablets) */
@media (max-width: 767px) {
    .party-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .party-modal-header {
        padding: 20px 16px 16px !important;
        padding-top: max(20px, env(safe-area-inset-top) + 12px) !important;
        min-height: 80px !important;
        position: relative !important;
    }

    /* Reset gauge size on mobile */
    .party-modal-header .mobile-checkin-gauge {
        width: 50px !important;
        height: 50px !important;
        left: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .party-modal-header .gauge-text {
        font-size: 0.65rem !important;
    }

    .party-modal-header .gauge-progress,
    .party-modal-header .gauge-background {
        stroke-width: 4 !important;
    }

    .party-modal-header .close-modal {
        top: 50% !important;
        right: 16px !important;
        transform: translateY(-50%) !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }


    .party-modal-header .confirmation-code,
    .party-modal-header .party-code {
        font-size: 0.75rem !important;
        padding: 5px 10px !important;
        border-radius: 6px !important;
    }

    .party-modal-body {
        padding: 16px 12px 12px !important;
        padding-top: 16px !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom) + 12px) !important;
        max-height: calc(100vh - 140px) !important;
    }

    /* Modern guest card responsive styles */
    .party-modal-body .guests-container {
        padding: 0 !important;
        gap: 12px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .party-modal-body .guests-grid {
        grid-template-columns: 1fr !important;
        /* Force single column - full width */
        gap: 12px !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .party-modal-body .guest-card {
        padding: 20px 16px !important;
        min-height: 70px !important;
        max-height: none !important;
        border-radius: 12px !important;
        margin: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .party-modal-body .guest-name {
        font-size: 1.05rem !important;
        font-weight: 500 !important;
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        border-radius: 8px !important;
        font-weight: 500 !important;
    }

    .party-modal-body .party-actions {
        padding: 16px 12px !important;
        gap: 12px !important;
    }

    .party-modal-body .btn-checkin-all,
    .party-modal-body .btn-submit {
        padding: 14px 20px !important;
        font-size: 1rem !important;
        min-height: 52px !important;
        border-radius: 12px !important;
        font-weight: 600 !important;
    }

    .party-modal-body .guest-card-header {
        min-height: auto;
        /* Better touch targets */
        gap: 6px;
        justify-content: center;
    }

    .party-modal-body .guest-name {
        font-size: 1.1rem;
        font-weight: 500;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .party-modal-body .guest-actions {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
    }

    .party-modal-body .guest-details {
        font-size: 0.75rem;
        font-weight: 400;
    }

    .party-modal-body .status-badge {
        display: none;
    }

    .party-modal-body .btn-checkin-all {
        padding: 14px 20px;
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        min-height: 52px;
        border-radius: 12px;
    }

    .guests-grid {
        padding: 16px;
        gap: 12px;
    }

    /* Mobile container and header adjustments */
    .checkin-container {
        padding: 16px;
        gap: 20px;
    }

    .main-title {
        font-size: 1.75rem;
        margin: 0.5rem 0 0.25rem 0;
    }

    .subtitle {
        font-size: 0.9rem;
        margin: 0 0 1rem 0;
    }

    .search-section {
        padding: 24px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {

    /* Full-screen modal for small mobile - optimized design */
    .party-modal-content {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .party-modal-header {
        padding: 14px 14px 10px;
        padding-top: max(14px, env(safe-area-inset-top) + 6px);
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
        position: sticky;
        top: 0;
        z-index: 10;
        min-height: auto;
    }

    .party-modal-header .party-header {
        margin: 0;
        padding: 0;
    }

    .party-modal-header .party-name {
        font-size: 1.35rem;
        margin: 0 0 6px 0;
    }

    .party-modal-header .party-info {
        margin-bottom: 6px;
        gap: 6px;
    }

    .party-modal-header .confirmation-code,
    .party-modal-header .party-code {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }

    .party-modal-header .checkin-progress {
        margin: 6px auto 0;
        padding: 5px 10px;
    }

    .party-modal-header .progress-text {
        font-size: 0.75rem;
    }

    .party-modal-body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom) + 10px);
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .party-modal-body .guests-container {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .party-modal-body .guests-grid {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    .party-modal-body .guest-card {
        padding: 18px 14px;
        min-height: 65px;
        max-height: none;
        border-radius: 12px;
        margin: 0;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        touch-action: manipulation;
        transform: none !important;
        animation: none !important;
    }

    .party-modal-body .guest-card:active {
        transform: none !important;
        background: var(--bg-hover);
    }

    .party-modal-body .guest-card.tapping {
        animation: none !important;
        transform: none !important;
    }

    .party-modal-body .guest-card-content {
        padding: 0;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        min-height: inherit;
        flex: 1;
    }

    .party-modal-body .guest-card-header {
        gap: 5px;
        min-height: auto;
        justify-content: center;
        width: 100%;
    }

    .party-modal-body .guest-info {
        gap: 4px;
        padding: 0;
    }

    .party-modal-body .guest-name {
        font-size: 1.05rem;
        font-weight: 500;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .party-modal-body .guest-first-name,
    .party-modal-body .guest-last-name {
        display: block;
        line-height: 1.4;
    }

    .party-modal-body .guest-meta-badges {
        margin-top: 5px;
        gap: 5px;
    }

    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .party-modal-body .guest-details {
        font-size: 0.7rem;
        font-weight: 400;
        margin-top: 3px;
    }

    .party-modal-body .guest-actions {
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
    }

    .party-modal-body .status-badge {
        display: none;
    }

    .party-modal-body .party-actions {
        gap: 10px;
        padding-top: 14px;
        padding-bottom: max(14px, env(safe-area-inset-bottom) + 14px);
        flex-direction: column;
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        z-index: 5;
    }

    .party-modal-body .btn-checkin-all,
    .party-modal-body .btn-submit {
        width: 100%;
        padding: 14px 18px;
        font-size: 0.95rem;
        min-width: auto;
        min-height: 50px;
        border-radius: 12px;
        justify-content: center;
    }

    /* Improve close button on mobile */
    .party-modal-header .close-modal {
        top: max(10px, env(safe-area-inset-top) + 8px);
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        min-width: 36px;
        min-height: 36px;
        transform: none;
    }

    .checkin-container {
        padding: 12px;
        gap: 16px;
    }

    .guests-grid {
        padding: 8px;
        gap: 6px;
    }

    .party-modal-header .close-modal {
        top: max(10px, env(safe-area-inset-top) + 8px);
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        min-width: 36px;
        min-height: 36px;
        transform: none;
        /* Better touch target */
    }






    .checkin-container {
        padding: 16px;
        gap: 24px;
    }

    .guests-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 0;
    }
}

/* iPad PWA Optimizations for Crisp Display */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Enhanced font rendering for iPad */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        font-feature-settings: 'kern' 1, 'liga' 1;
    }

    /* Better touch targets for iPad */
    .party-modal-body .guest-card {
        min-height: 100px;
        padding: 18px 50px 18px 50px;
        border-radius: 12px;
        margin: 6px 0;
        overflow: hidden;
    }

    .party-modal-body .guest-info {
        gap: 6px;
    }

    .party-modal-body .guest-name {
        font-size: 1.2rem;
    }

    .party-modal-body .guest-meta-info {
        font-size: 0.8rem;
    }

    .party-modal-body .guest-card:hover {
        transform: none;
        /* Remove transform for better crispness */
        box-shadow: var(--shadow-medium);
        background: var(--bg-hover);
        border-color: var(--border-light);
    }

    .party-modal-body .guest-name {
        font-size: 20px;
        font-weight: 500;
        line-height: 1.3;
    }

    .party-modal-body .guest-details {
        font-size: 0.85rem;
        font-weight: 500;
    }

    .party-modal-body .status-badge {
        display: none;
    }

    /* Text-based status indicators */

    /* iPad-specific modal sizing */
    .party-modal-content {
        max-width: 95%;
        width: 95%;
        border-radius: 8px;
    }

    .party-modal-header {
        padding: 28px 36px 20px;
        min-height: 70px;
    }

    .party-modal-body {
        padding: 20px 28px;
    }

    /* Removed - using consistent single column for party modal */
    /* .guests-grid selector here is for search view, not party modal */

    /* iPad search optimizations */
    .search-input {
        font-size: 20px;
        padding: 22px 52px 22px 28px;
    }

    .search-clear-btn {
        right: 14px !important;
        width: 20px !important;
        height: 20px !important;
        font-size: 0.9rem !important;
        transform: translateY(-105%) !important;
    }

    /* Better button sizing for iPad */
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .btn-sm {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 40px;
    }

    /* Progress text optimization */
    .party-modal-header .progress-text {
        font-size: 0.75rem;
        font-weight: 600;
        min-width: 60px;
    }
}

/* High-DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
        font-synthesis: none;
    }

    .party-modal-body .guest-card {
        border-width: 1px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .party-modal-body .status-badge {
        border-width: 1px;
        box-shadow: none;
    }
}

/* iPad landscape specific optimizations */
/* iPad Landscape - Party Modal Optimization (continued) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    #party-modal .party-modal-content {
        max-height: 100vh !important;
        height: 100vh !important;
        max-width: 100vw !important;
        width: 100vw !important;
        border-radius: 0 !important;
    }

    #party-modal .party-modal-header {
        padding: 24px 32px !important;
        min-height: 100px !important;
    }

    /* Larger gauge for iPad landscape */
    #party-modal .party-modal-header .mobile-checkin-gauge {
        width: 70px !important;
        height: 70px !important;
        left: 32px !important;
    }

    #party-modal .party-modal-header .gauge-text {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
    }

    #party-modal .party-modal-header .gauge-progress,
    #party-modal .party-modal-header .gauge-background {
        stroke-width: 5 !important;
    }

    #party-modal .party-modal-body {
        flex: 1 !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        padding: 40px 40px 0 40px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #party-modal .guests-container {
        flex: 1 !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        margin-bottom: 0 !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Center cards vertically for small groups (1-2 guests) on iPad landscape */
    #party-modal .guests-grid.one-guest,
    #party-modal .guests-grid.two-guests {
        grid-template-columns: 1fr !important;
        flex: 0 0 auto !important;
        margin: auto auto !important;
    }

    #party-modal .guests-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 28px !important;
        padding: 24px !important;
        padding-bottom: 20px !important;
        margin-bottom: 0 !important;
        max-width: 700px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 3 columns for large groups - full width */
    #party-modal .guests-grid.large-group {
        max-width: 100% !important;
    }

    /* Guest cards - immersive but fit properly */
    #party-modal .guest-card {
        padding: 36px 40px !important;
        border-radius: 20px !important;
        min-height: 160px !important;
    }

    /* Guest names - allow wrapping, smaller font for long names */
    #party-modal .guest-name {
        font-size: clamp(1.2rem, 1.5rem, 1.6rem) !important;
        font-weight: 500 !important;
        line-height: 1.4 !important;
        margin-bottom: 14px !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        overflow: visible !important;
        hyphens: none !important;
        width: auto !important;
        max-width: none !important;
    }

    #party-modal .guest-first-name,
    #party-modal .guest-last-name {
        display: block;
        line-height: 1.4;
    }

    /* Much larger badges */
    #party-modal .guest-code-badge,
    #party-modal .guest-table-badge {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
        border-radius: 12px !important;
        font-weight: 600 !important;
    }

    /* Larger action buttons - ensure they're visible and stick to bottom */
    #party-modal .party-actions {
        padding: 24px 32px !important;
        padding-bottom: max(40px, env(safe-area-inset-bottom) + 40px) !important;
        gap: 16px !important;
        flex-shrink: 0 !important;
        margin-top: auto !important;
        background: var(--bg-card) !important;
        position: relative !important;
        z-index: 10 !important;
        border-top: 1px solid var(--border-color) !important;
    }

    #party-modal .btn-checkin-all,
    #party-modal .btn-submit {
        padding: 18px 32px !important;
        font-size: 1.1rem !important;
        min-height: 60px !important;
        border-radius: 14px !important;
        font-weight: 600 !important;
    }

    /* Larger close button */
    #party-modal .close-modal {
        width: 44px !important;
        height: 44px !important;
        right: 32px !important;
        font-size: 1.1rem !important;
        border-radius: 12px !important;
    }

    /* Larger guests container padding */
    #party-modal .guests-container {
        padding: 0 !important;
    }
}

/* Fullscreen modal for larger screens (1025px+) */
@media (min-width: 1025px) and (orientation: landscape) {
    .party-modal-content {
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }

    /* Ensure badges match portrait/base view */
    .party-modal-body .guest-code-badge,
    .party-modal-body .guest-table-badge {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
        border-radius: 12px !important;
    }
}

/* PWA Standalone Mode Optimizations */
@media (display-mode: standalone) {

    /* Ensure body doesn't get locked */
    body {
        position: relative !important;
        overflow-x: hidden !important;
    }

    /* Ensure modals work properly in PWA */
    .modal {
        position: fixed !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content,
    .party-modal-content {
        pointer-events: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure all interactive elements are touchable */
    button,
    .close-modal,
    .guest-card,
    .btn-primary,
    .btn-secondary,
    .btn-checkin-all,
    .btn-submit {
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    /* Fix for iPad PWA camera orientation */
    #qr-modal .qr-reader video {
        object-fit: cover !important;
        transform: none !important;
    }
}