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

:root {
    --primary-gold: #d4af37;
    --deep-blue: #0f1419;
    --midnight-blue: #1a2332;
    --cosmic-purple: #2d1b69;
    --star-silver: #c9d1d9;
    --ethereal-blue: #4c9aff;
    --mystic-gradient: linear-gradient(135deg, #0f1419 0%, #2d1b69 50%, #1a2332 100%);
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f4d03f  50%, #d4af37 100%);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--mystic-gradient);
    color: var(--star-silver);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(76, 154, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(45, 27, 105, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Auth Screens */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: rgba(15, 20, 25, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary-gold);
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.auth-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--primary-gold);
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.auth-header p {
    color: var(--star-silver);
    margin-bottom: 20px;
    opacity: 0.8;
}

.auth-header h2 {
    color: var(--ethereal-blue);
    font-size: 1.3rem;
    font-weight: 500;
}

/* Forms */
.auth-form {
    margin-bottom: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(26, 35, 50, 0.5);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.form-section h3 {
    color: var(--primary-gold);
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 15px;
}

.input-row .input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--star-silver);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: var(--star-silver);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.input-group input:disabled,
.input-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: var(--gold-gradient);
    color: var(--deep-blue);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.auth-footer {
    text-align: center;
    color: var(--star-silver);
    opacity: 0.8;
}

.auth-footer a {
    color: var(--ethereal-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--primary-gold);
}

/* Main App */
.main-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-gold);
}

.logo i {
    font-size: 1.8rem;
}

.main-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--star-silver);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--star-silver);
}

.credits {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(212, 175, 55, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.credits i {
    color: var(--primary-gold);
}

.logout-btn,
.clear-btn {
    background: transparent;
    color: var(--star-silver);
    border: 1px solid rgba(201, 209, 217, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.logout-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff4757;
    color: #ff4757;
}

.clear-btn:hover {
    background: rgba(255, 165, 0, 0.2);
    border-color: #ffa502;
    color: #ffa502;
}

/* App Sections */
.app-section {
    flex: 1;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Chat Section */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: rgba(26, 35, 50, 0.8);
    padding: 20px;
    border-radius: 15px 15px 0 0;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credits-display {
    color: var(--star-silver);
    font-size: 0.9rem;
}

.credits-display strong {
    color: var(--primary-gold);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(15, 20, 25, 0.8);
    border-left: 1px solid rgba(212, 175, 55, 0.3);
    border-right: 1px solid rgba(212, 175, 55, 0.3);
}

.bot-message,
.user-message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--deep-blue);
    font-weight: bold;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--ethereal-blue);
    color: white;
}

.message-content {
    background: rgba(26, 35, 50, 0.8);
    border-radius: 15px;
    padding: 15px;
    max-width: 70%;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.user-message .message-content {
    background: rgba(76, 154, 255, 0.2);
    border-color: rgba(76, 154, 255, 0.3);
}

.suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.suggestion-btn {
    padding: 10px 15px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    color: var(--star-silver);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.9rem;
}

.suggestion-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: rgba(26, 35, 50, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 0 0 15px 15px;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: var(--star-silver);
    font-size: 1rem;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.chat-input button {
    padding: 12px 15px;
    background: var(--gold-gradient);
    color: var(--deep-blue);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* Chart Section */
.chart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.chart-header {
    text-align: center;
    margin-bottom: 30px;
}

.chart-header h2 {
    color: var(--primary-gold);
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.chart-info {
    color: var(--star-silver);
    font-size: 1.1rem;
    opacity: 0.8;
}

.chart-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.chart-wheel {
    background: rgba(15, 20, 25, 0.9);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
}

.chart-wheel canvas {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.chart-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.planets-section,
.houses-section,
.aspects-section {
    background: rgba(26, 35, 50, 0.8);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.planets-section h3,
.houses-section h3,
.aspects-section h3 {
    color: var(--primary-gold);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.planets-list,
.houses-list,
.aspects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.planet-item,
.house-item,
.aspect-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(15, 20, 25, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.planet-name,
.house-name,
.aspect-name {
    font-weight: 500;
    color: var(--ethereal-blue);
}

.planet-position,
.house-position,
.aspect-degree {
    color: var(--star-silver);
    font-size: 0.9rem;
}

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

.modal-content {
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h3 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.contact-info {
    margin: 20px 0;
    padding: 20px;
    background: rgba(26, 35, 50, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.whatsapp-btn {
    display: inline-block;
    padding: 12px 20px;
    background: #25d366;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

.close-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--star-silver);
    border: 1px solid rgba(201, 209, 217, 0.3);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--mystic-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Chatbot Avançado */
.chat-message.bot .bot-message {
    background: linear-gradient(135deg, rgba(76, 154, 255, 0.1) 0%, rgba(212, 175, 55, 0.1) 100%);
    border: 1px solid rgba(76, 154, 255, 0.2);
    padding: 20px;
    border-radius: 15px;
    position: relative;
}

.bot-avatar {
    width: 35px;
    height: 35px;
    background: var(--gold-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--deep-blue);
    font-weight: bold;
    margin-right: 12px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.message-content {
    display: flex;
    align-items: flex-start;
    max-width: 100%;
}

.message-text {
    flex: 1;
    line-height: 1.6;
    font-size: 14px;
}

.chat-message.bot .message-text {
    font-size: 15px;
    line-height: 1.7;
}

.chat-message.bot .message-text strong {
    color: var(--primary-gold);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 15px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-gold);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-message.system .system-message {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-style: italic;
    color: var(--primary-gold);
}

/* Melhorias para mensagens do usuário */
.chat-message.user .user-message {
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.8) 0%, rgba(45, 27, 105, 0.6) 100%);
    border: 1px solid rgba(201, 209, 217, 0.2);
    padding: 15px 20px;
    border-radius: 15px;
    margin-left: auto;
    max-width: 80%;
}

/* Responsividade aprimorada para chatbot */
@media (max-width: 768px) {
    .message-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bot-avatar {
        margin: 0 0 10px 0;
        align-self: flex-start;
    }
    
    .chat-message.bot .message-text {
        font-size: 14px;
    }
}
}

.loading-content {
    text-align: center;
    max-width: 400px;
}

.loading-icon {
    font-size: 4rem;
    color: var(--primary-gold);
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
}

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

.loading-content h3 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.loading-content p {
    color: var(--star-silver);
    margin-bottom: 20px;
    opacity: 0.8;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--gold-gradient);
    width: 0%;
    animation: loadingProgress 3s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .chart-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-wheel {
        padding: 20px;
    }
    
    .app-section {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .chat-container {
        height: calc(100vh - 160px);
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}