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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: #191919;
    line-height: 1.6;
    background-color: #fff;
    overflow-x: hidden;
}

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

/* Header Styles */
.header {
    padding: 20px 0;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    font-size: 24px;
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-item {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #191919;
    padding: 8px 0;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #666;
}

.nav-item.dropdown {
    display: flex;
    align-items: center;
    gap: 5px;
}

.arrow {
    font-size: 12px;
}

.nav-actions {
    display: flex;
    gap: 15px;
}

.btn-login {
    background: none;
    border: none;
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
    color: #191919;
    transition: color 0.3s;
}

.btn-login:hover {
    color: #666;
}

.btn-get-started {
    background: #191919;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-get-started:hover {
    background: #333;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #fff 0%, #fafafa 100%);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 72px;
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

.btn-hero {
    background: #191919;
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-hero:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Decorative Coins */
.coin {
    position: absolute;
    border-radius: 50%;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

.coin-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(15deg) rotateX(5deg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.coin-w {
    font-size: 60px;
    font-weight: bold;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.coin-chart {
    width: 80%;
    height: 60%;
    background: linear-gradient(to top, transparent 0%, rgba(255, 255, 255, 0.3) 100%);
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 10px;
}

.chart-percent {
    font-size: 18px;
    font-weight: bold;
    color: #191919;
}

/* Individual Coin Positions and Colors */
.coin-gold {
    width: 200px;
    height: 200px;
    top: 15%;
    left: 10%;
    background: linear-gradient(135deg, #f9d371 0%, #e8b84a 100%);
    animation-delay: 0s;
}

.coin-green {
    width: 250px;
    height: 250px;
    bottom: 15%;
    left: 8%;
    background: linear-gradient(135deg, #7ed957 0%, #5cb336 100%);
    animation-delay: 1s;
}

.coin-blue {
    width: 180px;
    height: 180px;
    top: 10%;
    right: 12%;
    background: linear-gradient(135deg, #a8d5e2 0%, #7ba7b5 100%);
    animation-delay: 2s;
}

.coin-orange {
    width: 220px;
    height: 220px;
    bottom: 20%;
    right: 10%;
    background: linear-gradient(135deg, #f9a66c 0%, #e8864a 100%);
    animation-delay: 1.5s;
}

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

/* Query Section */
.query-section {
    padding: 80px 0;
    background: #f9f9f9;
}

.query-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
}

.query-card h2 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 500;
}

.query-card p {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

.query-input-wrapper {
    margin-bottom: 20px;
}

#longevityQuery {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#longevityQuery:focus {
    outline: none;
    border-color: #191919;
}

.btn-submit {
    background: #191919;
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.btn-submit:hover {
    background: #333;
    transform: translateY(-2px);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.response-area {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    animation: fadeIn 0.5s;
}

.response-area h3 {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 500;
}

#responseText {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #191919;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .coin {
        display: none;
    }
    
    .query-card {
        padding: 30px 20px;
    }
    
    .query-card h2 {
        font-size: 28px;
    }
}

/* Login Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #191919;
}

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 500;
}

.modal-content p {
    color: #666;
    margin-bottom: 30px;
}

.btn-google-signin {
    width: 100%;
    background: #fff;
    border: 2px solid #e0e0e0;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    color: #191919;
}

.btn-google-signin:hover {
    background: #f8f8f8;
    border-color: #191919;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-disclaimer {
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

/* User Profile Styles */
.user-profile-btn {
    cursor: pointer;
    position: relative;
}

.nav-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
}

.nav-user-avatar:hover {
    border-color: #191919;
}

.user-dropdown {
    position: absolute;
    top: 70px;
    right: 20px;
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 1500;
    animation: fadeIn 0.3s;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.user-details {
    flex: 1;
    text-align: left;
}

.user-name {
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 4px;
    color: #191919;
}

.user-email {
    font-size: 13px;
    color: #666;
}

.btn-logout {
    width: 100%;
    background: #f5f5f5;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: #191919;
}

.btn-logout:hover {
    background: #e0e0e0;
}

.login-required {
    background: #f9f9f9;
    border: 2px dashed #e0e0e0;
    border-radius: 15px;
    padding: 40px 20px;
    margin-bottom: 20px;
    text-align: center;
}

.login-required p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

/* Query section authenticated state */
.query-input-wrapper.authenticated {
    opacity: 1;
    pointer-events: all;
}

.query-input-wrapper.locked {
    opacity: 0.5;
    pointer-events: none;
}

/* Advisor Page Styles */
.advisor-page {
    min-height: 100vh;
    padding: 60px 20px;
    background: linear-gradient(to bottom, #fafafa 0%, #fff 100%);
}

.advisor-header {
    text-align: center;
    margin-bottom: 50px;
}

.advisor-header h1 {
    font-size: 48px;
    font-weight: 500;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.advisor-header p {
    font-size: 20px;
    color: #666;
}

.checking-auth {
    text-align: center;
    padding: 80px 20px;
}

.checking-auth .spinner {
    margin: 0 auto 20px;
}

.checking-auth p {
    font-size: 18px;
    color: #666;
}

.not-authenticated {
    max-width: 600px;
    margin: 0 auto;
}

.auth-required-card {
    background: #fff;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-required-card h2 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 500;
}

.auth-required-card p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.advisor-interface {
    max-width: 900px;
    margin: 0 auto;
}

.user-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.user-welcome p {
    font-size: 18px;
    margin: 0;
}

.query-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.query-history {
    margin-top: 40px;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.query-history h3 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 500;
}

.history-item {
    padding: 15px;
    border-left: 3px solid #667eea;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    background: #f0f0f0;
    border-left-color: #764ba2;
    transform: translateX(5px);
}

.history-query {
    font-size: 16px;
    margin-bottom: 8px;
    color: #191919;
}

.history-query strong {
    color: #667eea;
}

.history-time {
    font-size: 12px;
    color: #999;
}

/* Responsive for advisor page */
@media (max-width: 768px) {
    .advisor-header h1 {
        font-size: 36px;
    }
    
    .advisor-header p {
        font-size: 16px;
    }
    
    .auth-required-card {
        padding: 40px 20px;
    }
    
    .query-card {
        padding: 30px 20px;
    }
}

