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

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
}

.container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.logo-svg {
    width: 50px;
    height: 50px;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 32px;
    font-weight: 300;
    color: #2d3748;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.sign-in-button {
    background: white;
    color: #2d3748;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sign-in-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.sign-out-button {
    background: white;
    color: #2d3748;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 24px;
}

.sign-out-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    background: #fee2e2;
    color: #991b1b;
}

.user-profile-image {
    margin: 24px 0;
}

.profile-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}

.user-info {
    margin: 24px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.user-email {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 8px;
}

.user-providers {
    font-size: 13px;
    color: #a0aec0;
}

.footer {
    margin-top: 48px;
    color: #a0aec0;
    font-size: 13px;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #4a5568;
}

.modal-title {
    font-size: 24px;
    font-weight: 300;
    color: #2d3748;
    margin-bottom: 32px;
    text-align: center;
}

.social-button {
    width: 100%;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
    color: #2d3748;
    font-weight: 500;
    margin-bottom: 12px;
}

.social-button:last-child {
    margin-bottom: 0;
}

.social-button:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.social-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.coming-soon {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 400;
    margin-left: 8px;
}

.social-icon {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #a0aec0;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    padding: 0 16px;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #2d3748;
    transition: all 0.2s ease;
}

.email-input:focus {
    outline: none;
    border-color: #667eea;
    background: #f7fafc;
}

.email-input::placeholder {
    color: #a0aec0;
}

.email-button {
    width: 100%;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
    color: #2d3748;
    font-weight: 500;
}

.email-button:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 32px;
    }

    h1 {
        font-size: 28px;
    }

    .modal {
        padding: 40px 32px;
    }

    .sign-in-button {
        padding: 14px 40px;
    }
}

/* Dashboard Styles */
:root {
    --bg-primary: #f0eee6;
    --bg-secondary: #e8e5dd;
    --text-primary: #1a1816;
    --text-secondary: #6b6862;
    --border: #d6d3ca;
}

[data-theme="dark"] {
    --bg-primary: #1a1816;
    --bg-secondary: #26241f;
    --text-primary: #f0eee6;
    --text-secondary: #a39d94;
    --border: #3d3a33;
}

/* Override body styles for dashboard */
body:has(.dashboard-container) {
    background: var(--bg-primary);
    color: var(--text-primary);
    display: block;
    align-items: unset;
    justify-content: unset;
    padding: 0;
    overflow: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background 0.3s, color 0.3s;
}

/* Header */
.header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.header-logo {
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.header-logo svg {
    width: 22px;
    height: 22px;
}

.site-name {
    font-size: 16px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sign-out-form {
    margin: 0;
    display: inline-block;
}

.sign-out-button-header {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
}

.sign-out-button-header:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sign-out-button-header svg {
    width: 16px;
    height: 16px;
}

.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
}

.menu-button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.menu-button svg {
    width: 20px;
    height: 20px;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 64px 32px;
    text-align: left;
}

.welcome {
    text-align: center;
    margin-bottom: 48px;
}

.dashboard-container .welcome h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: normal;
}

.welcome p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Module List */
.modules {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.module:hover {
    border-color: var(--text-secondary);
    transform: translateX(4px);
    background: var(--bg-secondary);
}

.module-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.module-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.module-name {
    font-size: 16px;
    font-weight: 500;
}

.module-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.module-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.module-count {
    font-size: 14px;
    font-weight: 500;
}

.module-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Status Bar */
.status-bar {
    margin-top: 48px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Dashboard Mobile */
@media (max-width: 768px) {
    .header {
        padding: 20px 24px;
    }

    .sign-out-button-header span {
        display: none;
    }

    .sign-out-button-header {
        padding: 8px;
    }

    .dashboard-container {
        padding: 48px 24px;
    }

    .dashboard-container .welcome h1 {
        font-size: 28px;
    }

    .module {
        padding: 16px 20px;
    }

    .module-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .module-meta {
        align-self: flex-start;
        text-align: left;
    }
}

/* Posts Styles */
body:has(.posts-container),
body:has(.post-container) {
    background: var(--bg-primary);
    color: var(--text-primary);
    display: block;
    align-items: unset;
    justify-content: unset;
    padding: 0;
    overflow: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.posts-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 64px 32px;
}

.posts-header {
    text-align: center;
    margin-bottom: 48px;
}

.posts-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: normal;
}

.posts-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.post-card:hover {
    border-color: var(--text-secondary);
    transform: translateX(4px);
    background: var(--bg-secondary);
}

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

.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.post-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.post-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.post-card-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.post-card-arrow svg {
    width: 20px;
    height: 20px;
}

.empty-state {
    text-align: center;
    padding: 64px 32px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin: 0 auto 24px;
}

.empty-state h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Post Detail Styles */
.post-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 64px 32px;
}

.post-content {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 48px;
}

.post-header {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.post-title-detail {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: normal;
    line-height: 1.2;
}

.post-meta-detail {
    font-size: 14px;
    color: var(--text-secondary);
}

.post-body {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-primary);
}

.post-body p {
    margin-bottom: 1.5em;
}

.post-body p:last-child {
    margin-bottom: 0;
}

.back-link {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Posts Mobile */
@media (max-width: 768px) {
    .posts-container,
    .post-container {
        padding: 48px 24px;
    }

    .posts-header h1,
    .post-title-detail {
        font-size: 28px;
    }

    .post-card {
        padding: 20px;
    }

    .post-content {
        padding: 32px 24px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-body {
        font-size: 16px;
    }
}