/* ========================================
   AstroPix Dashboard - Mobile-First Styles
   Matching Quiz App Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

:root {
    /* Quiz App Colors */
    --color-bg: #1A1528;
    --color-heading: #E8DFF5;
    --color-intro-text: #C9BFE0CC;
    --color-button-bg: #3D2960;
    --color-button-bg-hover: #5C4B8A;
    --color-footer-text: #FFFFFFB2;
    --color-footer-link: #FFF9E5;
    
    /* Extended Palette */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #d946ef;
    --bg-card: rgba(61, 41, 96, 0.5);
    --bg-card-hover: rgba(92, 75, 138, 0.5);
    --border-color: rgba(232, 223, 245, 0.15);
    --text-primary: #E8DFF5;
    --text-secondary: #C9BFE0;
    --text-muted: rgba(201, 191, 224, 0.6);
    --success: #22c55e;
    --error: #ef4444;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Nunito', sans-serif;
}

button, a, select, input {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

button:focus, a:focus, select:focus, input:focus {
    outline: none;
}

html {
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--color-bg);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100svh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
}

/* Container - Mobile First 450px */
.container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.dashboard-container,
.horoscopes-container,
.report-container {
    padding-bottom: 90px; /* Space for bottom nav */
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header {
    justify-content: space-between;
}

.report-header {
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.back-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-button-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 20px;
    transition: var(--transition-base);
}

.back-btn:hover {
    background: var(--color-button-bg-hover);
}

.header-spacer {
    width: 44px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 28px 0;
}

.main-content.centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 36px;
}

.welcome-section h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--color-heading);
}

.welcome-section p {
    color: var(--color-intro-text);
    font-size: 15px;
}

/* Login Card */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 36px 24px;
    text-align: center;
}

.login-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-heading);
}

.login-card > p {
    color: var(--color-intro-text);
    font-size: 15px;
    margin-bottom: 28px;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group input {
    width: 100%;
    padding: 18px 20px;
    background: rgba(26, 21, 40, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: var(--transition-base);
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 36px;
    background: var(--color-button-bg);
    border: none;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-base);
}

.btn-primary:hover {
    background: var(--color-button-bg-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-gradient:hover {
    opacity: 0.9;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-button-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-base);
}

.btn-icon:hover {
    background: var(--color-button-bg-hover);
}

/* Success/Error Messages */
.success-message {
    text-align: center;
    padding: 28px 0;
}

.success-message .success-icon {
    font-size: 56px;
    margin-bottom: 18px;
}

.success-message h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 15px;
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    color: var(--error);
    font-size: 14px;
    margin-top: 18px;
}

/* Features Section */
.features-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 36px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px 16px;
    text-align: center;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-heading);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Footer */
.footer {
    padding: 24px 0;
    display: flex;
    justify-content: center;
}

/* Language Select */
.language-select,
.language-select-small {
    background: var(--color-button-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 10px 18px;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    outline: none;
}

.language-select-small {
    padding: 8px 12px;
    font-size: 13px;
}

/* Dashboard Styles */
.dashboard-main,
.horoscopes-main,
.report-main {
    padding: 24px 0;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 28px;
}

.user-avatar {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 26px;
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
    word-break: break-all;
    text-align: left !important;
}

/* Section Styles */
.section {
    margin-bottom: 32px;
}

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

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-heading);
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* Report Card */
.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.report-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.report-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(26, 21, 40, 0.6);
    border-radius: var(--border-radius-sm);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    overflow: hidden;
}

.report-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-heading);
}

.report-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Horoscope Card */
.horoscope-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 22px;
    cursor: pointer;
    transition: var(--transition-base);
}

.horoscope-card:hover {
    background: var(--bg-card-hover);
}

.horoscope-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    text-align: left;
}

.horoscope-icon {
    font-size: 36px;
}

.horoscope-date {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-heading);
}

.horoscope-signs {
    font-size: 13px;
    color: var(--text-muted);
}

.horoscope-preview {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

/* Horoscopes List */
.horoscopes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.horoscope-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition-base);
}

.horoscope-list-item:hover {
    background: var(--bg-card-hover);
}

/* Page Title */
.page-title {
    margin-bottom: 28px;
}

.page-title h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--color-heading);
}

.page-title p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 18px;
}

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

.empty-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* Loading States */
.loading-placeholder {
    text-align: center;
    padding: 48px 24px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 18px;
}

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

/* Error State */
.error-state {
    text-align: center;
    padding: 48px 24px;
}

.error-icon {
    font-size: 56px;
    margin-bottom: 18px;
}

.error-state h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* Success State */
.success-state {
    text-align: center;
    padding: 48px 24px;
}

.loading-state {
    text-align: center;
    padding: 48px 24px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0;
    background: rgba(26, 21, 40, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 14px 0 20px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 36px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition-base);
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 24px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 21, 40, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.modal-content {
    background: var(--color-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 450px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-button-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
}

.horoscope-detail {
    padding: 28px;
}

.horoscope-detail h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-heading);
}

.horoscope-detail .signs {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.horoscope-detail .content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: left;
}

/* Report Content */
.report-content {
    padding: 24px 0;
}

.report-header-info {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    text-align: left;
}

.report-type-icon {
    font-size: 56px;
}

.report-type-info h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-heading);
}

.report-type-info p {
    color: var(--text-muted);
    font-size: 14px;
}

.report-image {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 28px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.report-image img {
    width: 100%;
    display: block;
}

.report-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.report-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 22px;
    text-align: left;
}

.report-section h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--primary);
}

.report-section p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Soulmate Image */
.soulmate-image {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 24px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
}

.soulmate-image img {
    width: 100%;
    display: block;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-left {
    text-align: left !important;
}

/* Safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .dashboard-container,
    .horoscopes-container,
    .report-container {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }
}
