/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Mode Defaults */
    --primary-color: #6366f1;
    --primary-hover: #5855f1;
    --secondary-color: #10b981;
    --background: #0b0b18;
    --surface: #15162e;
    --surface-light: #1f2144;
    --glass: rgba(26, 27, 58, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
body.light-mode {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #059669;
    --background: #f0f2f5;
    --surface: #ffffff;
    --surface-light: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease; /* Add transition for theme change */
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
}

.vault-animation {
    margin-bottom: 2rem;
}

.vault-body {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 12px;
    position: relative;
    margin: 0 auto;
    animation: vault-pulse 2s ease-in-out infinite;
}

.vault-door {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px;
    height: 60px;
    background: var(--surface);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vault-handle {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: vault-spin 3s linear infinite;
}

.loading-text {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes vault-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes vault-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes loading-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(11, 11, 24, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

/* Light-mode navbar override so top bar switches to light appearance when light mode is enabled */
body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
}

.brand-icon {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.brand-text {
    font-family: 'Space Mono', monospace;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.05em;
}

.brand-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-create {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: var(--transition);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Main Container */
.main-container {
    margin-top: 80px;
    margin-bottom: 48px;
}

.section {
    min-height: calc(100vh - 80px);
    padding: 2rem;
    display: none;
}

.section.active {
    display: block;
}

/* Home Section */
.section-home {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero {
    text-align: center;
    max-width: 1000px;
    position: relative;
    z-index: 2;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.floating-capsules {
    position: absolute;
    width: 100%;
    height: 100%;
}

.capsule {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: float-around 20s infinite linear;
}

.capsule-1 { top: 10%; left: 10%; animation-delay: 0s; }
.capsule-2 { top: 20%; right: 15%; animation-delay: 4s; }
.capsule-3 { bottom: 30%; left: 20%; animation-delay: 8s; }
.capsule-4 { bottom: 20%; right: 10%; animation-delay: 12s; }
.capsule-5 { top: 50%; left: 50%; animation-delay: 16s; }

@keyframes float-around {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(90deg); }
    50% { transform: translate(-20px, -50px) rotate(180deg); }
    75% { transform: translate(-40px, 20px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.next-unlock {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
    border: 1px solid var(--border);
}

.unlock-label {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.time-unit {
    text-align: center;
}

.time-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Space Mono', monospace;
}

.time-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Create Tabs */
.create-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.create-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: calc(var(--border-radius) - 4px);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.create-tab-btn.active,
.create-tab-btn:hover {
    background: var(--primary-color);
    color: white;
}

.tab-icon {
    font-size: 1.25rem;
}

.create-tab-content {
    display: none;
}

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

/* Buttons */
.btn {
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-wide {
    width: 100%;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover .btn-glow {
    left: 100%;
}

/* Explore Section */
.section-explore {
    padding: 4rem 2rem;
}

.section-header {
    max-width: 1200px;
    margin: 0 auto 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.explore-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-bar {
    display: flex;
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.search-bar input {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 250px;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-hover);
}

.sort-select {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    outline: none;
}

/* Capsules Grid */
.capsules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.capsule-card {
    background: var(--surface);
    background-image: linear-gradient(to bottom right, rgba(255,255,255,0.02), transparent);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.capsule-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(99, 102, 241, 0.5);
    background-color: var(--surface-light);
}

/* Adding specific model viewer styling */
model-viewer {
  --poster-color: transparent;
  background-color: transparent;
}

.archive-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.archive-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(16, 185, 129, 0.5);
    background-color: var(--surface-light);
}

.capsule-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.capsule-card:hover::before {
    transform: scaleX(1);
}

.capsule-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.capsule-icon {
    font-size: 2rem;
    filter: grayscale(100%);
    transition: var(--transition);
}

.capsule-card:hover .capsule-icon {
    filter: grayscale(0%);
}

.capsule-info h3, .archive-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.capsule-author {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.capsule-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.capsule-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.capsule-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.status-locked {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-unlocked {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Create Section */
.section-create {
    padding: 4rem 2rem;
}

.create-container {
    max-width: 600px;
    margin: 0 auto;
}

.capsule-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.upload-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-text span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--background);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.5rem;
}

.file-details h4 {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

.archive-file {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem; margin-bottom: 1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    max-width: 600px;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-heavy);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

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

.modal-body {
    padding: 2rem;
}

/* Toast Styles */
.toast {
    background: var(--surface);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-medium);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--secondary-color);
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

/* Other Products Section */
.section-other-products {
    padding: 4rem 2rem;
    text-align: center;
}

.other-products-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

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

.product-card.coming-soon {
    opacity: 0.7;
}

.product-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.product-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.product-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.coming-soon-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Profile Section */
.section-profile {
    padding: 4rem 2rem;
}

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

#profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.profile-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.profile-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: calc(var(--border-radius) - 4px);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Settings Section */
.section-settings {
    padding: 4rem 2rem;
}

.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.settings-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    border-right: 1px solid var(--border);
}

.settings-tab:last-child {
    border-right: none;
}

.settings-tab.active,
.settings-tab:hover {
    background: var(--primary-color);
    color: white;
}

.settings-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.settings-panel {
    display: none;
    padding: 2rem;
}

.settings-panel.active {
    display: block;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.theme-option:hover {
    border-color: var(--primary-color);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.theme-preview {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.theme-option span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Locking Options */
.locking-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.radio-option input[type="radio"] {
    accent-color: var(--primary-color);
}

/* Tutorial Box */
.tutorial-box {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.tutorial-icon {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.tutorial-box ul {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.tutorial-box li {
    margin-bottom: 0.25rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

.scroll-text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.scroll-arrow {
    font-size: 1.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Edit/Delete buttons on capsule cards */
.edit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.edit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Capsule media styles */
.capsule-content-media {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border: 1px solid var(--border);
}

/* Metadata grid for archives */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .create-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .create-tab-btn {
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }
    
    .create-tab-btn:first-child {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .create-tab-btn:last-child {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        border-bottom: none;
    }
    
    .customization-grid,
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    .create-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .archive-type-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .archive-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .archives-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .archive-type-selector {
        grid-template-columns: 1fr;
    }
    
    .archive-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f0f23;
        --surface: #1a1b3a;
        --surface-light: #2a2d5f;
        --text-primary: #ffffff;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* Focus styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .floating-capsules,
    .btn,
    .modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* New styles for Likes and Comments */
.capsule-card-actions, .archive-actions {
    display: flex;
    justify-content: flex-end; 
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.capsule-card-action-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.capsule-card-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.capsule-card-action-btn:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1); /* Assuming primary-color can be converted to rgb */
}

/* In-modal styles for likes and comments */
.capsule-actions-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align to the right of the description */
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.likes-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.like-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: var(--text-secondary); /* Default color for unliked */
}

.like-btn[data-liked="true"] {
    color: #ef4444; /* Red color for liked state */
    transform: scale(1.1);
}

.like-btn:hover {
    transform: scale(1.2);
}

.comments-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.comments-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-list {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto; /* Push time to the right */
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.5;
}

.comment-content p {
    margin-bottom: 0.5em; /* Spacing between paragraphs in markdown */
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
    border: 1px solid var(--border);
    max-height: 300px; /* Limit height for images in comments */
    object-fit: contain; /* Ensure images fit without cropping */
}

.comments-section form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comments-section textarea {
    width: 100%;
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: var(--transition);
}

.comments-section textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.comments-section .btn-primary {
    align-self: flex-end; /* Align button to the right */
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* Small layout tweaks for Discover grids */
.section-discover .capsules-grid,
.section-discover .archives,
#videos-grid,
#games-grid,
#discover-archives-grid,
#capsules-grid {
    margin-top: 1rem;
}

/* Updates Section */
.section-updates {
    padding: 4rem 2rem;
}

.updates-container .update-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.update-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.updates-container .update-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

/* Footer */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    z-index: 999;
    font-size: 0.9rem;
}

/* Footer left alignment and small adjustments for TOS button */
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.footer-left { display: flex; align-items: center; justify-content: flex-start; gap: .5rem; color: var(--text-secondary); }
.footer-version { color: var(--text-secondary); font-size: 0.9rem; }

/* Terms of Service modal body styling for long text */
.tos-body {
    max-height: 60vh;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Ensure modal-close style visible */
.modal-close { font-size: 1.25rem; }

/* Ensure Enlarge/Shrink buttons look distinct but simple */
.rebrand-speech {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.02);
}

#enlarge-rebrand-btn, #shrink-rebrand-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

.discover-tabs { margin-left: auto; display:flex; gap:.5rem; align-items:center; }
#discover-featured-container .capsule-card { border-width: 2px; }
#discover-featured-container .capsule-card .capsule-status { background: rgba(99,102,241,0.08); color: var(--primary-color); }