:root {
    --plum: #6B46C1;
    --jade: #34D399;
    --surface-bg: #F5F5F7;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--surface-bg);
    overflow: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: block;
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.3), rgba(52, 211, 153, 0.2));
    z-index: -1;
}

/* Glass Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.glass-card-inner {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
}

.glass-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.3s;
}

.glass-input:focus {
    border-color: var(--plum);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.glass-button {
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(107, 70, 193, 0.3);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.glass-button.primary {
    background: linear-gradient(135deg, var(--plum), var(--jade));
    color: white;
    border: none;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.glass-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.logo {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(107, 70, 193, 0.3);
}

.welcome-text {
    text-align: center;
}

.welcome-subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 4px;
}

.welcome-title {
    font-size: 52px;
    font-weight: 800;
    margin: 0;
}

.gradient-text {
    background: linear-gradient(90deg, var(--plum), var(--jade));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animated {
    background: linear-gradient(90deg, var(--plum), var(--jade), var(--plum));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 2s ease-in-out infinite alternate;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5), 0 0 12px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.login-form {
    width: 100%;
}

.forgot-password {
    background: none;
    border: none;
    color: var(--plum);
    font-size: 14px;
    cursor: pointer;
    margin-top: -8px;
    margin-bottom: 16px;
}

.signup-hint {
    font-size: 14px;
    color: var(--plum);
    text-align: center;
    margin-top: 12px;
    max-width: 320px;
}

.toggle-auth {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--plum);
    cursor: pointer;
}

.login-about-wrapper {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.error-message {
    background: rgba(255, 0, 0, 0.15);
    border: 2px solid rgba(200, 0, 0, 0.5);
    color: #b00;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin: 12px 0;
    text-align: center;
    min-height: 20px;
}

.error-message:not(.hidden) {
    display: block;
}

.error-message.hidden {
    display: none !important;
}

/* Navigation */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar h1 {
    font-size: 20px;
    font-weight: 600;
}

.nav-icon {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-icon {
    background: linear-gradient(135deg, var(--plum), var(--jade));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grey-icon {
    background: linear-gradient(135deg, white, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content */
.content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    overflow-y: auto;
    height: calc(100vh - 120px);
}

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

.group-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
}

.group-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(107, 70, 193, 0.3);
}

.group-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.group-info p {
    font-size: 14px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Bottom Toolbar */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.toolbar-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.icon-button-with-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.icon-button-with-label .icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.icon-button-with-label .icon-label {
    font-size: 11px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    -webkit-text-fill-color: #555;
    background: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-cancel {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
}

/* Profile Modal */
.profile-avatar-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.avatar-preview-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.profile-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #999;
    font-weight: 600;
}

.profile-email-readonly {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* About Modal */
.about-content {
    text-align: center;
}

.about-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin: 20px auto;
    box-shadow: 0 12px 24px rgba(107, 70, 193, 0.3);
}

.about-section {
    margin: 24px 0;
}

.about-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.about-value {
    font-size: 20px;
    font-weight: 700;
}

.about-text {
    font-size: 16px;
}

.about-text-italic {
    font-style: italic;
    color: var(--plum);
    margin-top: 12px;
    font-size: 18px;
}

.mission {
    padding: 20px;
}

.mission-icons {
    font-size: 28px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.heart-icon {
    animation: heartbeat 1.2s ease-in-out infinite alternate;
    background: linear-gradient(135deg, var(--plum), var(--jade));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    100% { transform: scale(1.4); }
}

.inspire-text {
    color: #666;
    margin: 8px 0;
    background: linear-gradient(90deg, #999, white, #999);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: inspireShift 2.5s ease-in-out infinite alternate;
}

@keyframes inspireShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.power-prayer {
    font-size: 38px;
    font-weight: 900;
    margin: 12px 0;
}

.email-icon {
    font-size: 24px;
    color: var(--plum);
    margin-bottom: 8px;
}

.email-link {
    color: var(--plum);
    text-decoration: none;
    font-weight: 500;
}

.copyright {
    font-size: 12px;
    color: #999;
    margin-top: 24px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.text-button {
    background: none;
    border: none;
    color: var(--plum);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
}

/* Prayer Cards */
.prayer-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.prayer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.prayer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.prayer-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--jade);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .content {
        padding: 12px;
    }

    .modal-content {
        margin: 20px;
    }
}
