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

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    color: #111827;
    overflow-x: hidden;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: transparent;
}

.menu-btn, .sun-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.menu-btn:hover, .sun-btn:hover {
    transform: scale(1.1);
}

/* Logo Section */
.logo-section {
    padding: 0.5rem 0 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-logo {
    max-width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .avatar-logo {
        max-height: 240px;
    }
}

/* Search Container */
.search-container {
    width: 100%;
    max-width: 500px;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: none;
    border-radius: 2rem;
    background-color: #e5e7eb;
    font-size: 1rem;
    color: #374151;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-input:focus {
    background-color: #d1d5db;
}

/* Button Container */
.button-container {
    padding: 0.5rem 0 2rem;
    display: flex;
    justify-content: center;
}

.connect-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid #facc15;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    background-color: #facc15;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: auto;
}

.connect-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
}

.connect-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.connect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.connect-btn.connected {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Features List */
.features-list {
    width: 100%;
    max-width: 500px;
    padding: 0 1rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-card {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    background-color: #f3f4f6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.feature-card:active {
    transform: scale(0.95);
}

.feature-card.unavailable {
    opacity: 0.5;
    cursor: default; /* Not clickable yet */
}

.feature-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon-container {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.feature-card:hover .icon-container {
    transform: scale(1.1);
}

.feature-content {
    flex: 1;
    min-width: 0;
}

.feature-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.feature-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.arrow {
    flex-shrink: 0;
    color: #d1d5db;
    font-size: 1.5rem;
    margin-top: 0.25rem;
    transition: transform 0.3s ease;
}

.feature-card:hover .arrow {
    transform: translateX(0.25rem);
}

@media (max-width: 768px) {
    .feature-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .icon-container {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }

    .feature-title {
        font-size: 0.9rem;
    }

    .feature-description {
        font-size: 0.75rem;
    }
}

/* Progress Modal - Dark Design */
.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.progress-modal.hidden {
    display: none;
}

.custom-modal {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 1.5rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.custom-modal-icon {
    background-color: #f3f4f6;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.custom-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    flex-grow: 1;
    text-align: center;
    padding: 0 1rem;
}

.custom-modal-close {
    background-color: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #6b7280;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.custom-modal-close:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.custom-modal-processing-text {
    color: #4b5563;
    font-size: 0.95rem;
    margin: 0;
}

.custom-modal-progress-bar-wrapper {
    width: 100%;
    height: 12px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.custom-modal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #facc15 0%, #fbbf24 100%);
    width: 0%;
    transition: width 0.3s ease-out;
    border-radius: 10px;
}

.custom-modal-progress-percent {
    font-size: 1.1rem;
    font-weight: 700;
    color: #d97706; /* slightly darker yellow/orange for light mode visibility */
    text-align: center;
}

/* Offer Wall Styles */
.offer-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    background-color: #0b0b0b;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    z-index: 100;
    overflow: hidden; /* For watermark */
}

.offer-wall.hidden {
    display: none !important;
}

/* Best Friends Wall */
.best-friends-wall {
    width: 100%;
    min-height: 100vh;
    background-color: #f7f5f4; /* Light off-white */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
}

.best-friends-wall.hidden {
    display: none !important;
}

.bf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.bf-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #000;
    margin: 0;
}

.bf-select-btn {
    background-color: #e5e7eb;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
}

.bf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.bf-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-width: 0;
}

.bf-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0.75rem;
    position: relative;
}

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

.bf-avatar.has-story::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid #9c27b0;
    border-radius: 50%;
    z-index: 1;
}

.bf-avatar.has-lock::after {
    content: '🔒'; /* We'll use a styled element or emoji */
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #9c27b0;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 2;
    border: 2px solid #ffffff;
}

.bf-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
}

.bf-name {
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bf-stats {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.bf-radio {
    width: 24px;
    height: 24px;
    border: 1.5px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 0.5rem;
    transition: all 0.2s;
    background-color: transparent;
}

.bf-card.selected .bf-radio {
    background-color: #facc15;
    border-color: #facc15;
    position: relative;
}

.bf-card.selected .bf-radio::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

