/* Main app and guest page shared styles */
* {
    box-sizing: border-box;
}

body.main-app,
body.guest-page {
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-app .container {
    max-width: 800px;
}

.guest-page .container {
    max-width: 900px;
}

.container {
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2em;
}

.header p {
    margin: 10px 0 0;
    opacity: 0.9;
}

.nav {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 8px;
}

.main-app .nav {
    flex-direction: row;
    flex-wrap: nowrap;
}

.main-app .nav.main-tabs {
    align-items: stretch;
}

.main-app .nav.main-tabs button {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.guest-page .nav button {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.guest-page .nav {
    flex-direction: row;
}

.guest-page .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.guest-page .header .header-home-link {
    color: #fff;
}

.guest-header-top {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 14px;
}

.guest-page .nav {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.guest-page .nav button.active {
    background: #667eea;
    color: #fff;
}

.guest-page .search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.guest-page .result {
    border-left-color: #667eea;
}

.guest-page .result .table {
    color: #667eea;
}

.nav button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.3s;
    text-align: left;
    color: #333;
}

.nav button.active {
    background: #667eea;
    color: #fff;
}

.nav button:hover:not(.active) {
    background: #e9ecef;
}

.content {
    padding: 30px;
}

.tab-content {
    display: none;
}

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

.admin-section,
.guest-section {
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.required-star {
    color: #d93025;
    font-weight: 700;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.file-upload {
    border: 2px dashed #667eea;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    background: #f0f4ff;
}

.file-upload.dragover {
    background: #e0e7ff;
    border-color: #5568d3;
}

.file-upload input {
    display: none;
}

.file-upload-text {
    color: #666;
    font-size: 14px;
}

.pro-only-upload {
    display: none;
}

.pro-only-upload.visible {
    display: block;
}

.tab-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #d4af37;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.hidden-tab {
    display: none !important;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 18px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.result {
    background: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease;
}

.result .name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.result .table {
    font-size: 1.5em;
    color: #667eea;
    font-weight: 700;
    margin-top: 8px;
}

.result .guest-id {
    font-size: 0.8em;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.qr-section {
    margin-top: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.qr-code-container canvas,
.qr-code-container img {
    border: 10px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.floorplan-container {
    margin-top: 20px;
}

.guest-page .floorplan-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floorplan-container img,
.floorplan-preview {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.event-list {
    max-height: 300px;
    overflow-y: auto;
}

.event-item {
    background: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
}

.event-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.event-item.active {
    background: #667eea !important;
    color: white !important;
    border-left-color: white !important;
}

.event-name {
    font-weight: 600;
    font-size: 1.1em;
}

.event-date {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 5px;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 30px;
    font-style: italic;
}

.guest-count {
    background: #e9ecef;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
}

.selected-event-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.selected-event-actions button {
    flex: 1;
}

.auth-header {
    background: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-header-left,
.auth-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-header-right {
    margin-left: auto;
}

.user-display-name {
    font-weight: 500;
    color: #444;
}

.account-badge {
    display: none;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid #ddd;
    align-items: center;
    line-height: 1;
}

.account-badge .pro-crown {
    color: #d4af37;
    margin-right: 4px;
    font-size: 12px;
    line-height: 1;
}

.account-badge .pro-label {
    line-height: 1;
}

.btn.login-btn,
.btn.logout-btn {
    padding: 5px 15px;
}

.btn.upgrade-btn {
    display: none;
    padding: 5px 15px;
    background: #ffc439;
    color: #111;
    border: none;
    font-weight: bold;
}

.btn.logout-btn {
    background: #666;
}

.login-panel {
    display: none;
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.google-icon {
    margin-right: 10px;
}

.login-copy {
    color: #666;
    margin-bottom: 30px;
}

.login-google-btn {
    padding: 12px 30px;
    font-size: 16px;
}

.home-link-wrap {
    margin-top: 20px;
}

.home-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-home-link {
    position: static;
    color: #667eea;
    z-index: 25;
}

.main-app .header-home-link {
    color: #667eea;
}

@media (max-width: 640px) {
    .auth-header {
        padding: 8px 10px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .auth-header-left,
    .auth-header-right {
        width: 100%;
    }

    .auth-header-left {
        justify-content: flex-start;
        margin-bottom: 6px;
    }

    .auth-header-right {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
        margin-left: 0;
        min-width: 0;
    }

    .user-display-name {
        font-size: 13px;
        word-break: break-word;
    }

    .btn.login-btn,
    .btn.logout-btn,
    .btn.upgrade-btn {
        padding: 4px 10px;
        font-size: 12px;
        line-height: 1.1;
    }

    .auth-header .btn.logout-btn {
        margin-left: auto;
    }

    .account-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .header-home-link {
        font-size: 12px;
    }
}

.main-app-panel,
.guest-panel,
.qr-panel {
    display: none;
}

.check-console-note {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

.selected-event-info {
    display: none;
    margin-top: 20px;
}

.selected-event-date-group {
    margin-bottom: 15px;
}

.delete-event-btn {
    background: #dc3545;
}

.qr-section-hidden {
    display: none;
}

.cloud-note {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.modal-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
}

.modal-description {
    color: #666;
    margin-bottom: 25px;
}

.modal-plan-box {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    background: #f8f9fa;
    margin-bottom: 25px;
    text-align: left;
}

.modal-plan-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.modal-plan-row .plan-value {
    color: #667eea;
    font-weight: 700;
}

.modal-plan-divider {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-plan-note {
    font-size: 14px;
    color: #666;
}

.modal-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.modal-original-price {
    font-size: 24px;
    font-weight: 600;
    color: #8c8c8c;
    text-decoration: line-through;
}

.modal-plan-price {
    font-size: 28px;
    font-weight: 800;
}

.modal-email-note {
    font-size: 11px;
    color: #999;
    margin-top: 15px;
}

.modal-email-note strong {
    color: #666;
}

.pdf-preview {
    width: 100%;
    height: 80vh;
    min-height: 720px;
    max-height: 90vh;
    display: block;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

#paypal-container-RGK3SQYQ4CU32 {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Landing page core styles */
.section-wrapper {
    padding: 100px 30%; /* Add breathing room on both sides. */
    max-width: 1200px;
    margin: 0 auto;
}

.feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 120px; /* Increase vertical spacing between rows. */
    gap: 80px;            /* Increase horizontal spacing between text and image. */
}

.feature-text {
    flex: 1.2; /* Let the text take slightly more space. */
    text-align: left;
}

.feature-text h3 {
    font-size: 2rem;
    color: #764ba2;
    margin-bottom: 20px;
}

.feature-text p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.8;
}

.feature-image-box {
    flex: 1;
    display: flex;
    justify-content: center; /* Keep the image centered in its column. */
    align-items: center;
}

.feature-image {
    width: 100%;       /* Take full width on smaller screens. */
    max-width: 420px;  /* Limit the image to 420px on all screens. */
    height: auto;      /* Preserve aspect ratio. */
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    
    /* Center alignment. */
    display: block;
    margin: 0 auto;
}

.step-image {
    width: 100%;
    max-width: 380px; /* Limit image size for a cleaner look. */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.step-image:hover {
    transform: translateY(-10px);
}

/* Mobile layout: stack vertically and center the text. */
@media (max-width: 768px) {
    .section-wrapper { padding: 50px 5%; }
    .feature-row { 
        flex-direction: column !important; 
        gap: 40px; 
        margin-bottom: 80px;
    }
    .feature-text { text-align: center; }
}

@media (max-width: 480px) {
    body.guest-page {
        padding: 6px;
    }

    .guest-page .container {
        border-radius: 10px;
    }

    .guest-page .header {
        padding: 16px 12px 14px;
    }

    .guest-header-top {
        margin-bottom: 8px;
    }

    .guest-page .header h1 {
        font-size: 1.5em;
        line-height: 1.15;
    }

    .guest-page .header p {
        font-size: 0.95rem;
        margin-top: 6px;
    }

    .guest-page .nav {
        padding: 8px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .guest-page .nav button {
        padding: 10px 8px;
        font-size: 13px;
        border-radius: 7px;
        flex: 1 1 calc(50% - 6px);
    }

    .guest-page .content {
        padding: 16px 12px 20px;
    }

    .guest-page .search-box input {
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 18px;
    }

    .guest-page .result {
        padding: 12px;
        margin: 8px 0;
    }

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

    .guest-page .result .table {
        font-size: 1.25rem;
    }

    .guest-page .floorplan-container {
        margin-top: 14px;
    }

    .guest-page .floorplan-container img,
    .guest-page .floorplan-preview,
    .guest-page .pdf-preview {
        max-width: 100%;
        height: auto;
    }

    .guest-page .header .header-home-link {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .guest-page .header {
        padding: 14px 10px 12px;
    }

    .guest-page .header h1 {
        font-size: 1.35em;
    }

    .guest-page .nav button {
        flex-basis: 100%;
    }

    .guest-page .content {
        padding: 14px 10px 18px;
    }

    .guest-page .search-box input {
        font-size: 15px;
    }

    .guest-page .pdf-preview {
        height: 68vh;
        min-height: 420px;
        max-height: 72vh;
    }
}

@media (max-width: 320px) {
    .guest-page .header {
        padding: 12px 8px 10px;
    }

    .guest-page .header h1 {
        font-size: 1.25em;
    }

    .guest-page .header p {
        font-size: 0.85rem;
    }

    .guest-page .header .header-home-link {
        font-size: 12px;
    }

    .guest-page .nav {
        padding: 6px;
        gap: 5px;
    }

    .guest-page .nav button {
        padding: 9px 6px;
        font-size: 12px;
    }

    .guest-page .content {
        padding: 12px 8px 16px;
    }

    .guest-page .search-box input {
        padding: 11px 12px;
        font-size: 14px;
    }

    .guest-page .result .table {
        font-size: 1.1rem;
    }

    .guest-page .pdf-preview {
        height: 64vh;
        min-height: 360px;
        max-height: 66vh;
    }
}

@media (max-width: 280px) {
    .guest-page .container {
        border-radius: 8px;
    }

    .guest-page .header {
        padding: 10px 6px 8px;
    }

    .guest-page .header h1 {
        font-size: 1.1em;
    }

    .guest-page .header p {
        font-size: 0.8rem;
    }

    .guest-page .nav button {
        flex-basis: 100%;
        padding: 8px 6px;
        font-size: 11px;
    }

    .guest-page .content {
        padding: 10px 6px 14px;
    }

    .guest-page .search-box input {
        padding: 10px 10px;
        font-size: 13px;
    }

    .guest-page .result {
        padding: 10px;
    }

    .guest-page .result .name {
        font-size: 0.95rem;
    }

    .guest-page .result .table {
        font-size: 1rem;
    }

    .guest-page .pdf-preview {
        height: 58vh;
        min-height: 300px;
        max-height: 60vh;
    }
}

.guest-promo-link {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    color: #666;
    background: #fff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

@media (max-width: 640px) {
    .guest-promo-link {
        padding: 12px 10px;
        font-size: 12px;
    }

    .guest-promo-link a {
        font-size: 12px;
    }
}

.guest-promo-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.guest-promo-link a:hover {
    text-decoration: underline;
}

/* Event limit info box styles */
.event-limit-info {
    margin-bottom: 20px;
}

.info-box {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.info-icon {
    font-size: 18px;
}

.info-text {
    flex: 1;
}

.pro-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.pro-info .info-icon {
    color: #ffd700;
}

.free-info {
    background: #e9ecef;
    color: #333;
}

.free-info .info-icon {
    color: #666;
}

.limit-reached {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.limit-reached .info-icon {
    color: #ffc107;
}

.limit-reached a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.limit-reached a:hover {
    color: #5568d3;
}
