:root {
    --primary-color: #f2555c;
    /* Red Spazio Gioco Brand */
    --secondary-color: #50E3C2;
    /* Teal Accent */
    --accent-color: #F5A623;
    /* Orange for Actions */
    --text-color: #333333;
    --bg-color: #F4F7F6;
    --white: #FFFFFF;
    --danger: #E74C3C;
    --success: #2ECC71;
    --gray-light: #E0E0E0;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.btn {
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.1s;
    font-size: 1rem;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-google {
    background-color: #DB4437;
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

.btn-telegram {
    background-color: #0088cc;
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

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

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

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

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

.full-width {
    width: 100%;
}

/* View: Home */
.view-home {
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Branding Colors for Home Page Only (Logo: Red, White, Green) */
    --primary-color: #CE2B37;
    --primary-dark: #A3141E;
    /* Darker red for gradients */
    --secondary-color: #009246;
    --text-on-primary: #FFFFFF;
    --hero-bg: #FFFFFF;
}

.view-home .hero {
    /* White Header for Logo Pop */
    background: var(--hero-bg);
    color: var(--text-color);
    /* Reduced top padding significantly, added safe-area */
    padding: calc(15px + env(safe-area-inset-top)) 20px 50px 20px;
    position: relative;
    border-radius: 0 0 50% 50% / 0 0 25px 25px;
    /* Slightly shallower curve */
    margin-bottom: 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Green strip removed as per user request */

.view-home .hero .subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 30px;
}

/* Flex container for buttons: Column layout */
.view-home .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
}

/* Custom Primary Button for Home - Red Gradient */
.view-home .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(206, 43, 55, 0.5);
    /* Stronger Red Shadow */
    border: none;
    padding: 12px 35px;
    /* Larger */
    font-size: 1.25rem;
    /* Larger Text */
    font-weight: 700;
    border-radius: 50px;
    /* Pill Shape */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    animation: btnPulse 3s infinite;
}

.view-home .btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(206, 43, 55, 0.6);
    background: linear-gradient(135deg, #FF4552 0%, #C41C29 100%);
    animation: none;
    /* Stop pulse on hover */
}

/* Subtle shine effect */
.view-home .btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.view-home .btn-primary:hover::after {
    left: 100%;
    opacity: 1;
    transition: left 0.5s;
}

@keyframes btnPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(206, 43, 55, 0.5);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 30px rgba(206, 43, 55, 0.7);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(206, 43, 55, 0.5);
    }
}

.view-home .info-section {
    display: grid;
    gap: 25px;
    padding: 0 20px 40px 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.view-home .card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    /* Soft, premium shadow */
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.view-home .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1);
}

.view-home .card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.view-home .card p {
    color: #555;
    font-size: 1rem;
}

/* Home View Supplemental */
.app-logo {
    max-width: 220px;
    /* Increased from 150px */
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.info-section {
    padding: 0 20px;
    display: grid;
    gap: 20px;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: left;
}

/* Modern Floating Shapes */
.shape-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    z-index: 0;
    opacity: 0.6;
    animation: floatShape 10s infinite ease-in-out alternate;
}

.shape-blob.one {
    width: 200px;
    height: 200px;
    background: rgba(206, 43, 55, 0.15);
    /* Red tint */
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.shape-blob.two {
    width: 250px;
    height: 250px;
    background: rgba(0, 146, 70, 0.1);
    /* Green tint */
    bottom: -80px;
    right: -50px;
    animation-delay: -5s;
}

.shape-blob.three {
    width: 150px;
    height: 150px;
    background: rgba(74, 144, 226, 0.1);
    /* Blue tint */
    top: 40%;
    left: 20%;
    animation-duration: 15s;
    opacity: 0.4;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, 30px) scale(1.1);
    }

    100% {
        transform: translate(-20px, 10px) scale(0.9);
    }
}

/* Ensure content sits above shapes */
.view-home .hero>* {
    position: relative;
    z-index: 2;
}

/* Staggered Card Entrance */
.view-home .card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUpCard 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.view-home .card:nth-child(1) {
    animation-delay: 0.1s;
}

.view-home .card:nth-child(2) {
    animation-delay: 0.2s;
}

.view-home .card:nth-child(3) {
    animation-delay: 0.3s;
}

.view-home .card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes fadeInUpCard {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Instagram Button Upgrade */
.btn-instagram {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: 50px;
    background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(221, 42, 123, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 5;
    position: relative;
}

.btn-instagram:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(221, 42, 123, 0.4);
}

/* View: Dashboard */
.view-dashboard {
    padding-bottom: 80px;
}

/* Space for eventual footer */

.app-header {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    cursor: pointer;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.actions-bar {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tables-grid {
    padding: 0 20px;
    display: grid;
    gap: 15px;
}

.table-card {
    /* Dynamics borders handled by JS */
}

.table-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.table-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-open {
    background: #e0f7fa;
    color: #006064;
}

.status-full {
    background: #ffebee;
    color: #c62828;
}

.participants-preview {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 8px;
    margin-bottom: 15px;
}

.participant-chip {
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Color variations for chips (generated by JS hash) */
.remove-participant {
    margin-left: 6px;
    cursor: pointer;
    color: #c62828;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.remove-participant:hover {
    background-color: rgba(198, 40, 40, 0.1);
}

.chip-color-0 {
    background-color: #e3f2fd;
    color: #1565c0;
}

.chip-color-1 {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.chip-color-2 {
    background-color: #fff3e0;
    color: #ef6c00;
}

.chip-color-3 {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.chip-color-4 {
    background-color: #ffebee;
    color: #c62828;
}

.chip-color-5 {
    background-color: #e0f2f1;
    color: #00695c;
}

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

.modal-content {
    background-color: var(--white);
    margin: 20% auto;
    padding: 25px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: fadeInUp 0.3s;
}

.close,
.close-create {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.modal-actions.end {
    justify-content: flex-end;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 1rem;
}

/* Responsive */
@media (min-width: 768px) {
    .tables-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        border-radius: 0 0 50px 50px;
    }
}

/* Detailed Expander */
.table-card {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.table-details {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    margin-top: 0;
}

.table-card.expanded .table-details {
    max-height: 500px;
    /* Arbitrary large max-height */
    opacity: 1;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-light);
}

.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.bgg-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #3f3da3;
    /* BGG Blue-ish */
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 10px;
}

.bgg-link:hover {
    text-decoration: underline;
}

.game-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.game-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Delete Icon */
.delete-icon {
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.7;
    padding: 4px;
}

.delete-icon:hover {
    transform: scale(1.2);
    opacity: 1;
}

.btn-disabled {
    background-color: var(--gray-light);
    color: #999;
    cursor: not-allowed;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--gray-light);
    background-color: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow);
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-light);
    transition: background-color 0.2s;
}

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

.autocomplete-item:hover {
    background-color: #f0f0f0;
}

.game-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.game-info-box p {
    margin: 5px 0;
}


/* Profile View */
.profile-container {
    padding: 20px;
}

.profile-card {
    max-width: 600px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-lg {
    font-size: 4rem;
    display: block;
    margin: 0 auto 10px auto;
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
}

.user-role {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.form-section {
    margin: 25px 0;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

.form-section h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.sub-toggle {
    margin-left: 20px;
    font-size: 0.9rem;
    color: #555;
    transition: opacity 0.3s;
}

/* Switch Toggle Style */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Game Icon in Table Card */
.game-icon-small {
    width: 60px;
    height: 60px;
    object-fit: contain;
    /* Contain to keep aspect ratio inside square, or cover if preferred */
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid var(--gray-light);
    flex-shrink: 0;
}

/* Make table header title align better with icon */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.table-header>div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    /* Allow text truncate or wrap properly */
}

.table-header h4 {
    margin: 0;
    line-height: 1.2;
    font-size: 1.1rem;
    word-break: break-word;
    /* Prevent overflow on long words */
}

.table-header small {
    display: block;
    margin-top: 4px;
    color: #666;
}

.table-header>div:last-child {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .app-header {
        padding: 12px 15px;
    }

    .actions-bar {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
    }

    .actions-bar h2 {
        font-size: 1.5rem;
    }

    .btn-sm {
        padding: 10px;
        font-size: 1rem;
        width: 100%;
    }

    .tables-grid {
        padding: 0 15px 15px 15px;
        gap: 12px;
    }

    .card {
        padding: 15px;
    }

    .table-details {
        font-size: 0.95rem;
    }

    .view-dashboard {
        padding-bottom: 100px;
    }

    .modal-content {
        margin: 15% auto;
        width: 95%;
        padding: 20px;
    }

    /* Stack buttons in mobile */
    .table-actions {
        flex-direction: column;
    }

    .table-actions button {
        width: 100%;
    }
}

/* Safe Area Support for Smartphones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .view-dashboard {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* Home View Supplemental */
.map-container iframe {
    width: 100%;
    height: 300px;
    border-radius: var(--radius);
    border: none;
}

.btn-instagram {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 99px;
    background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    font-family: var(--font-main);
}

.btn-instagram:hover {
    transform: scale(1.05);
}

/* Pull to Refresh */
#pullToRefresh {
    position: absolute;
    top: -60px;
    /* Hidden by default */
    left: 0;
    width: 100%;
    height: 60px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    color: #666;
    font-size: 0.9rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    transition: height 0.3s ease;
}

#pullToRefresh .pull-icon {
    font-size: 24px;
    transition: transform 0.3s;
}

.pull-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

#pullToRefresh.refreshing .pull-icon {
    display: none;
}

#pullToRefresh.refreshing .pull-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loader Screen */
.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeOut 0.5s ease-out 0.5s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.loader-screen p {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.loader-screen .spinner {
    width: 60px;
    height: 60px;
    animation: rotate 2s linear infinite;
}

.loader-screen .spinner-path {
    stroke: var(--primary-color);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* PWA Install Prompt - Modern Manual Design */
.pwa-install-prompt {
    position: fixed;
    bottom: 24px;
    left: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 16px;
    z-index: 9999;
    animation: slideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@keyframes slideUp {
    from {
        transform: translateY(120%) scale(0.95);
        opacity: 0;
    }

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

.pwa-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 24px;
}

.pwa-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pwa-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 10px;
}

.pwa-text strong {
    font-size: 1.05rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.pwa-text small {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.35;
    font-weight: 500;
}

.pwa-close-absolute {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.pwa-close-absolute:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.pwa-btn-install {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
    /* Adjusted shadow color to match primary blue */
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.pwa-btn-install:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.2);
}

@media (min-width: 768px) {
    .pwa-install-prompt {
        left: auto;
        right: 30px;
        bottom: 30px;
        width: 360px;
        backdrop-filter: saturate(180%) blur(20px);
    }
}

/* Styled Select for modern dropdowns */
.styled-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    font-size: 16px;
    /* Ensure 16px to prevent iOS zoom */
    font-family: inherit;
    color: #333;
    background-color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    line-height: 1.3;
}

.styled-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

/* Toggle Switch */
.form-group .toggle-switch {
    display: flex !important;
    /* Force flex to override block */
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background-color: #ccc;
    /* Darker gray for visibility */
    border-radius: 34px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

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

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

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

.toggle-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.2;
}

/* Public Tables View */
.view-public-tables {
    min-height: 100vh;
    background: var(--bg-color);
}

.public-header {
    background: white;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.public-header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.public-header .subtitle {
    color: #666;
    font-size: 0.95rem;
}

.public-logo {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.public-logo:hover {
    transform: scale(1.05);
}

.public-footer {
    text-align: center;
    padding: 40px 20px;
}

.public-footer p {
    margin-bottom: 15px;
    color: #666;
}

/* Guest Login Button - Match Google/Telegram widget style */
.btn-guest-login {
    display: block;
    width: 250px;
    height: 44px;
    margin: 20px auto 0 auto;
    margin-bottom: 15px;
    padding: 0 16px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-family: 'Roboto', 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
}

.btn-guest-login:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3);
    border-color: #dadce0;
}

.btn-guest-login:active {
    background: #eeeeee;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
}