:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --accent: #22d3ee;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0, transparent 50%);
    color: var(--text-main);
    font-family: 'Outfit', -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
}

/* Header Styles */
.glass-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

textarea {
    resize: vertical;
    min-height: 350px;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
}

#text {
    height: 100%;
}

.upload-zone {
    width: 100%;
    min-height: 120px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(124, 77, 255, 0.05);
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(124, 77, 255, 0.1);
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.2);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    text-align: center;
    padding: 20px;
}

.upload-content svg {
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.upload-zone:hover .upload-content svg {
    transform: scale(1.1);
    color: var(--accent-primary);
}

.upload-zone.has-files .upload-content {
    display: none;
}

.upload-zone {
    width: 100%;
    min-height: 120px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.file-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(124, 77, 255, 0.15);
    padding: 12px 24px;
    border-radius: 12px;
    display: none;
    border: 1px solid rgba(124, 77, 255, 0.3);
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-count::before {
    content: '✓';
    font-size: 2rem;
    display: block;
}

.file-count.active {
    display: flex;
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: scaleIn 0.3s ease;
}

.preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(12, 16, 32, 0.82);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: background 0.18s ease, transform 0.18s ease;
}

.preview-remove:hover {
    background: rgba(220, 38, 38, 0.92);
    transform: scale(1.06);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-list {
    margin-top: 12px;
}

.audio-preview-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(124, 77, 255, 0.1);
    padding: 8px 42px 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.2);
    color: var(--accent-primary);
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.preview-remove-audio {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.preview-remove-audio:hover {
    transform: translateY(-50%) scale(1.06);
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.logo h1 {
    font-size: 1.25rem !important;
    font-weight: 600;
    margin-bottom: 0 !important;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.version {
    font-size: 0.75rem;
    opacity: 0.5;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.locale-switcher {
    position: relative;
}

.locale-button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.locale-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
}

.locale-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.locale-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.locale-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 116px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    padding: 10px 0;
    overflow: hidden;
    z-index: 1002;
}

.locale-option {
    width: 100%;
    border: none;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
    padding: 13px 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.locale-option:hover {
    background: #f8fafc;
    color: #0f172a;
}

.locale-option.active {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
    color: #2563eb;
    font-weight: 600;
}

.btn-signin {
    position: relative;
    border: 1px solid rgba(167, 139, 250, 0.45);
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(236, 72, 153, 0.18)),
        rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    padding: 0.72rem 1.2rem;
    min-height: 42px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 10px 22px rgba(15, 23, 42, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-signin:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.5);
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.34), rgba(236, 72, 153, 0.26)),
        rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 14px 28px rgba(15, 23, 42, 0.32);
}

.btn-signin:active {
    transform: translateY(0);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 8px 18px rgba(15, 23, 42, 0.24);
}

.btn-signin:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(34, 211, 238, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 14px 28px rgba(15, 23, 42, 0.32);
}

.user-tools {
    position: relative;
}

.avatar-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px 12px 4px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
}

.avatar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.arrow-down {
    font-size: 0.7rem;
    opacity: 0.85;
    line-height: 1;
}

.chevron {
    font-size: 0.6rem;
    opacity: 0.6;
}


.user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

/* OncePing 風格 Pill 按鈕 */
.avatar-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 2px 10px 2px 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-1px);
}

/* OncePing 風格下拉選單 */
.dropdown-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    background: #ffffff; /* OncePing 純白底色 */
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    transform-origin: top right;
    transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 1001;
    overflow: hidden;
}

.dropdown-panel.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
    pointer-events: none;
}

.user-info {
    padding: 18px 20px 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 4px;
}

.identity-badge {
    font-size: 0.95rem;
    font-weight: 400;
    color: #111827;
    margin: 0;
}

.user-email {
    font-size: 0.85rem;
    color: #9ca3af; /* 更優雅的淡灰色 */
    margin-top: 2px;
}

.wallet-info {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid #f3f4f6;
}

.balance-row, .expiry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #4b5563;
}

.balance-row {
    margin-bottom: 8px;
}

.balance-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
    background: #222;
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.balance-pill small {
    display: inline-block;
    font-weight: 400;
    opacity: 0.9;
    margin-left: 0;
}

.expiry-val {
    font-family: 'Outfit', sans-serif;
    color: #111827;
    font-weight: 500;
}

/* OncePing 風格選單項目 - 色彩與風格 */
.dropdown-item {
    display: flex;
    align-items: center;
    font-weight: 400;
    color: #111827;
    padding: 13px 20px; /* 增加高度，更有質感 */
    gap: 12px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #000;
}

.dropdown-item.logout-item {
    color: #ef4444 !important; /* Once 標準紅 */
}

.dropdown-item.logout-item:hover {
    background: #fef2f2;
}

.item-icon {
    width: 18px;
    height: 18px;
    color: #374151;
}

.logout-item .item-icon {
    color: #ef4444;
}

.dropdown-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 0px 0;
}


.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.hero-section {
    text-align: center;
    padding: 3rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto;
    font-weight: 400;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.workspace-shell {
    position: relative;
}

.locked-content {
    transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.workspace-shell.is-locked .locked-content {
    /* Relaxed: Allow users to see the UI even if not logged in */
    /* filter: blur(6px); */
    /* opacity: 0.4; */
    /* pointer-events: none; */
}

/* Blur only when the guest gate is active */
body.gate-active .workspace-shell .locked-content {
    filter: blur(10px);
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

.guest-gate {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.btn-close-gate {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-gate:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: rotate(90deg);
}

.guest-gate-panel {
    width: min(620px, 100%);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.94));
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.42);
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.guest-gate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.32);
    color: #e9d5ff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.guest-gate-panel h2 {
    font-size: 1.9rem;
    line-height: 1.2;
    margin-bottom: 0.9rem;
}

.guest-gate-panel p {
    color: #cbd5e1;
}

.guest-gate-actions {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-auth-primary,
.btn-auth-secondary {
    min-width: 160px;
    justify-content: center;
}

.guest-gate-note {
    margin-top: 1rem;
    font-size: 0.92rem;
    color: #a5b4fc;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    padding: 0.75rem 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
}

textarea {
    height: 120px;
    resize: none;
}

.row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Ensure multi-row wrapping if needed */
}

.half {
    flex: 1;
    min-width: 140px;
}

.full {
    flex: 1 1 100%;
}

.toggle-group {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px;
    border-radius: 0.75rem;
    gap: 4px;
}

.toggle-group input {
    display: none;
}

.toggle-group label {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.toggle-group input:checked + label {
    background: var(--primary);
    color: white;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.action-bar {
    text-align: center;
    margin: 3rem 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    padding: 1rem 3rem;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Status and Result */
.status-card, .result-card {
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

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

.log-console {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
    height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    text-align: left;
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-item {
    margin-bottom: 0.25rem;
    border-left: 2px solid var(--primary);
    padding-left: 8px;
}

.video-preview {
    margin: 2rem 0;
    border-radius: 1rem;
    overflow: hidden;
    background: black;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

video {
    width: 100%;
    display: block;
}

small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.input-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.input-group select, .input-group input {
    margin-bottom: 0 !important;
}

.input-suffix {
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

.advanced-settings {
    margin: 2rem 0;
}

.advanced-settings summary {
    font-weight: 600;
    color: var(--text-dim);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.advanced-settings summary::before {
    content: '▶';
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.advanced-settings[open] summary::before {
    transform: rotate(90deg);
}

.advanced-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 1rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
}

.marketing-footer {
    width: 100%;
    margin-top: 6rem;
    padding: 80px 0 40px;
    background: rgba(9, 15, 28, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.marketing-footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 0.8fr));
    gap: 40px;
}

.marketing-footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.marketing-footer-mark {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
}

.marketing-footer-brand strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.marketing-footer-brand p {
    margin: 0;
    color: var(--text-dim);
    line-height: 1.8;
}

.marketing-footer-list {
    display: grid;
    align-content: start;
    gap: 10px;
}

.marketing-footer-list h3 {
    margin: 0 0 2px;
    color: #dce8f7;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marketing-footer-list a {
    color: #c2d3ea;
    line-height: 1.7;
    text-decoration: none;
}

.marketing-footer-list a:hover {
    color: #ffffff;
}

.marketing-footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 24px 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #9eb5d3;
    font-size: 0.85rem;
    opacity: 0.6;
}

@media (max-width: 640px) {
    .guest-gate {
        padding: 1rem 0.25rem 1.5rem;
    }

    .guest-gate-panel {
        border-radius: 22px;
        padding: 1.4rem 1rem;
    }

    .guest-gate-panel h2 {
        font-size: 1.45rem;
    }

    .guest-gate-actions {
        flex-direction: column;
    }

    .btn-auth-primary,
    .btn-auth-secondary {
        width: 100%;
        min-width: 0;
    }

    .marketing-footer {
        margin: 4rem 0 0;
        padding: 40px 0 20px;
        border-radius: 0;
    }

    .marketing-footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 24px;
    }
    
    .marketing-footer-brand {
        flex-direction: column;
        gap: 12px;
    }
    
    .marketing-footer-brand p {
        max-width: 100%;
        font-size: 0.95rem;
    }

    .marketing-footer-bottom {
        text-align: center;
        margin-top: 32px;
        padding: 20px 24px 0;
    }

    .hero-section {
        padding: 2.5rem 0 1.5rem;
    }

    .hero-section h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    textarea {
        min-height: 200px;
    }
}

/* Modal System */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-panel {
    position: relative;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    max-width: 1300px; /* Widened by 30% from 1000px */
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.btn-close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.btn-close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* Pricing Section */
.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h2 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-header p {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.plan-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.plan-card.featured {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
}

.plan-badge {
    position: absolute;
    top: 1.2rem;
    right: -2.5rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 3rem;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-price {
    margin-bottom: 2rem;
}

.plan-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.plan-currency {
    font-size: 0.95rem;
    color: var(--text-dim);
    display: block;
    margin-top: 0.2rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
    flex-grow: 1;
}

.plan-features li {
    font-size: 0.95rem;
    color: #cbd5e1;
    padding: 0.6rem 0;
    display: flex;
    align-items: center;
}

.plan-features li::before {
    content: "✓";
    color: var(--accent);
    margin-right: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.btn-buy {
    width: 100%;
    padding: 1rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy:hover {
    filter: brightness(1.2);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.pricing-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.pricing-note {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.payment-methods {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.payment-logo {
    height: 28px;
    opacity: 0.5;
    filter: grayscale(1) invert(1);
    transition: all 0.3s;
}

.payment-logo:hover, .payment-logo.active {
    opacity: 1;
    filter: invert(1);
}

/* Buyout Card Special Styles */
.buyout-card {
    background: linear-gradient(165deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.buyout-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
    animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.1); opacity: 0.6; }
}

.buyout-badge {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.highlight-glow {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.highlight-glow:hover {
    box-shadow: 0 0 35px rgba(139, 92, 246, 0.4);
}

.price-escalator {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.25rem 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.escalator-title {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.schedule-item.active {
    color: #fff;
    font-weight: 600;
}

.schedule-date {
    width: 45px;
    font-family: 'Courier New', monospace;
}

.schedule-dash {
    flex-grow: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.schedule-item.active .schedule-dash {
    background: var(--primary);
    border-bottom: none;
    opacity: 0.5;
}

.schedule-price {
    font-variant-numeric: tabular-nums;
}

.schedule-item.active .schedule-price {
    color: var(--accent);
}

.btn-buyout {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
}

.btn-buyout:hover {
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

@media (max-width: 1100px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .modal-panel {
        padding: 2rem 1.5rem;
    }
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-header h2 {
        font-size: 1.75rem;
    }
}

/* History Modal */
.history-panel {
    max-width: 1235px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem 1.5rem 0.5rem;
}

.history-content {
    overflow-y: auto;
    padding: 1.5rem;
}

.table-container {
    width: 100%;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.history-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    font-weight: 600;
}

.history-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-pending {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

/* Draggable Previews */
.preview-item {
    position: relative;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.preview-item:active {
    cursor: grabbing;
}

.preview-drag-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.4);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.preview-item:hover .preview-drag-handle {
    opacity: 1;
}

.preview-number-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--primary) !important;
    transform: scale(0.95);
    box-shadow: 0 0 15px var(--primary);
}
