/* ============================================
   BeanShare Page Styles
   Home, Help, Notifications, Profile,
   Settings, Spaces Index
   ============================================ */

/* --- Shared Page Buttons --- */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

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

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

.btn-secondary {
    background: var(--bs-gray-100);
    color: #475569;
    border: 1px solid var(--bs-border);
}

.btn-secondary:hover {
    background: var(--bs-border);
}

.btn-danger {
    background: var(--bs-error-light);
    color: var(--bs-error);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-action {
    background: var(--bs-surface);
    color: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-action:hover {
    background: var(--bs-primary-subtle);
}

/* --- Home / Landing Page --- */

.bs-landing-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bs-primary-light) 0%, var(--bs-background-light) 100%);
}

.bs-landing-content {
    max-width: 64rem;
    text-align: center;
}

.bs-landing-header {
    margin-bottom: 3rem;
}

.bs-landing-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--bs-text);
    margin: 0 0 1rem 0;
}

.bs-landing-subtitle {
    font-size: 1.25rem;
    color: var(--bs-text-subtle);
    margin: 0;
}

.bs-landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.bs-feature-card {
    background-color: var(--bs-background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bs-feature-icon {
    font-size: 3rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

.bs-feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.bs-feature-card p {
    color: var(--bs-text-subtle);
    margin: 0;
}

.bs-landing-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .bs-landing-title {
        font-size: 2rem;
    }

    .bs-landing-subtitle {
        font-size: 1rem;
    }

    .bs-landing-features {
        grid-template-columns: 1fr;
    }
}

/* --- Help Page --- */

.bs-faq-item {
    border-bottom: 1px solid var(--bs-border);
    padding: 0.5rem 0;
}

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

details[open] summary {
    color: var(--bs-primary);
}

kbd {
    font-family: monospace;
    font-size: 0.875rem;
}

/* --- Notifications Page --- */

.notification-item {
    background: var(--bs-white);
    border: 1px solid var(--bs-border);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-item:hover {
    border-color: var(--bs-primary-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.notification-read {
    opacity: 0.7;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bs-primary-light);
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--bs-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Profile Page --- */

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

.profile-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #1e40af 100%);
    border-radius: 16px;
    margin-bottom: 2rem;
    padding: 3rem;
    color: white;
}

.profile-header-content {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.avatar-container {
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
}

.profile-avatar-placeholder span {
    font-size: 80px;
    color: var(--bs-gray-400);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--bs-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.avatar-upload-btn:hover {
    background: var(--bs-primary-dark);
    transform: scale(1.1);
}

.avatar-upload-btn span {
    font-size: 18px;
    color: white;
}

.avatar-upload-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.avatar-upload-error {
    font-size: 0.75rem;
    color: var(--bs-error-light);
    padding: 0.25rem 0.5rem;
    background: rgba(220, 38, 38, 0.3);
    border-radius: 4px;
}

.profile-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.profile-email {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0 0 0.5rem 0;
}

.profile-joined {
    font-size: 0.875rem;
    opacity: 0.8;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-section {
    background: var(--bs-surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 1.5rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bs-gray-50);
    border-radius: 12px;
    transition: transform 0.2s;
}

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

.stat-icon {
    font-size: 2.5rem;
    color: var(--bs-primary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-text);
}

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

.spaces-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.space-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bs-gray-50);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.space-card:hover {
    background: var(--bs-gray-100);
    transform: translateX(4px);
}

.space-card-icon {
    width: 48px;
    height: 48px;
    background: var(--bs-surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-primary);
}

.space-card-content {
    flex: 1;
}

.space-card-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 0.5rem 0;
}

.space-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin {
    background: var(--bs-warning-light);
    color: var(--bs-warning-dark);
}

.badge-member {
    background: #dbeafe;
    color: #2563eb;
}

.space-members {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
}

.space-card-action {
    color: var(--bs-gray-400);
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-text-subtle);
}

.info-value {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value input,
.info-value select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--bs-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bs-surface);
}

.info-value input:disabled,
.info-value select:disabled {
    background: var(--bs-gray-50);
    color: var(--bs-text);
}

.verified-badge {
    color: #10b981;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.danger-zone {
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.danger-zone h2 {
    color: var(--bs-error-dark);
}

.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bs-surface);
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.danger-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 0.25rem 0;
}

.danger-item p {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
    margin: 0;
}

/* NOTE: .empty-state is now defined in beanshare.css (shared) */

@media (max-width: 768px) {
    .profile-container {
        padding: 1rem;
    }

    .profile-header {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .profile-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-avatar,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
    }

    .profile-avatar-placeholder span {
        font-size: 50px;
    }

    .profile-info h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-icon {
        font-size: 1.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .profile-section {
        padding: 1rem;
    }

    .profile-actions {
        flex-direction: column;
    }

    .danger-item {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .profile-container {
        padding: 0.5rem;
    }

    .profile-header {
        padding: 1rem;
        border-radius: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* --- Settings Page --- */

.settings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.settings-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bs-text);
    margin: 0 0 0.5rem 0;
}

.settings-header p {
    color: var(--bs-text-subtle);
    font-size: 1.125rem;
}

.settings-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-nav button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--bs-text-subtle);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.settings-nav button:hover {
    background: var(--bs-gray-100);
    color: #475569;
}

.settings-nav button.active {
    background: var(--bs-primary);
    color: white;
}

.settings-panel {
    background: var(--bs-surface);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.panel-content {
    flex: 1;
    padding: 2rem;
}

.panel-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 0.5rem 0;
}

.panel-description {
    color: var(--bs-text-subtle);
    margin: 0 0 2rem 0;
}

.setting-group {
    margin-bottom: 2.5rem;
}

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

.setting-group h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 1rem 0;
}

.theme-selector {
    display: flex;
    gap: 1rem;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.theme-option input {
    display: none;
}

.theme-preview {
    width: 100px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.theme-option.active .theme-preview {
    border-color: var(--bs-primary);
}

.light-preview {
    background: #f8fafc;
    color: #1e293b;
}

.dark-preview {
    background: #1e293b;
    color: white;
}

.auto-preview {
    background: linear-gradient(90deg, #f8fafc 50%, #1e293b 50%);
    color: var(--bs-primary);
}

.color-selector {
    display: flex;
    gap: 1rem;
}

.color-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.color-option:hover {
    transform: scale(1.1);
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bs-gray-50);
    border-radius: 8px;
}

.toggle-item label {
    font-weight: 500;
    color: var(--bs-text);
}

.toggle-item p {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
    margin: 0.25rem 0 0 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bs-gray-300);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

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

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

.two-factor-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bs-gray-50);
    border-radius: 12px;
    border: 2px solid var(--bs-border);
}

.two-factor-status.enabled {
    background: #f0fdf4;
    border-color: #86efac;
}

.two-factor-status span {
    font-size: 2rem;
}

.two-factor-status.enabled span {
    color: var(--bs-success);
}

.two-factor-status.disabled span {
    color: var(--bs-gray-400);
}

.status-label {
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 0.25rem 0;
}

.status-description {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
    margin: 0;
}

.two-factor-status .btn-secondary {
    margin-left: auto;
}

.connected-accounts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bs-gray-50);
    border-radius: 8px;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-info img {
    width: 24px;
    height: 24px;
}

.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    padding: 1.5rem;
    background: var(--bs-gray-50);
    border-radius: 12px;
    text-align: center;
}

.integration-icon {
    width: 64px;
    height: 64px;
    background: var(--bs-surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--bs-primary);
}

.integration-icon span {
    font-size: 2rem;
}

.integration-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 0.5rem 0;
}

.integration-card p {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
    margin: 0 0 1rem 0;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-text-subtle);
    margin-bottom: 0.5rem;
}

.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--bs-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bs-surface);
}

.storage-info {
    margin-bottom: 1rem;
}

.storage-bar {
    width: 100%;
    height: 8px;
    background: var(--bs-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.storage-used {
    height: 100%;
    background: var(--bs-primary);
}

.storage-info p {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
}

.panel-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--bs-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Settings Modal (Change Password) */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bs-surface);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

.modal-close {
    background: transparent;
    border: none;
    color: var(--bs-text-subtle);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bs-gray-100);
}

.modal-content {
    padding: 1.5rem;
}

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

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-text-subtle);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--bs-border);
    border-radius: 8px;
    font-size: 1rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--bs-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

@media (max-width: 768px) {
    .settings-content {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .integration-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Spaces Index --- */

.quick-consumption-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.4);
    transition: all 0.2s;
    z-index: 50;
}

.quick-consumption-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(65, 105, 225, 0.5);
}

.quick-consumption-fab:active {
    transform: scale(0.95);
}

.quick-consumption-fab .material-symbols-outlined {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .quick-consumption-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}
