/* Main CSS for Celestial Insights Astrology Website */

:root {
    --primary-color: #5b3a94;
    --secondary-color: #9c64e2;
    --accent-color: #ff9d00;
    --accent-hover: #ffb340;
    --text-color: #333;
    --light-text: #f0f0f0;
    --dark-bg: #1c1c2e;
    --card-bg: #ffffff;
    --gradient-start: #2c1e4a;
    --gradient-end: #422e71;
    --box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Nirmala UI', Arial, sans-serif; /* Added Nirmala UI for better Hindi display */
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
    color: var(--light-text);
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px 0;
    display: none;
}

.card.active {
    display: block;
    animation: fadeInUp 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

input[type="text"],
input[type="date"],
input[type="time"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(156, 100, 226, 0.15);
    transition: box-shadow 0.3s;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', 'Nirmala UI', Arial, sans-serif; /* For Hindi text in buttons */
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(91, 58, 148, 0.3);
    animation: pulse 0.4s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.07); }
    100% { transform: scale(1); }
}

/* Chart Section Styles */
.chart-top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.chart-container {
    position: relative;
    min-height: 320px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.8s;
}

.chart-area {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f9f9ff 0%, #f0f0f8 100%);
    border-radius: 15px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

#natal-chart {
    width: 100%;
    height: auto;
    max-height: 500px;
    margin: 0 auto;
}

#natal-chart:hover {
    box-shadow: 0 8px 32px rgba(91,58,148,0.18);
}

#chart-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px;
    width: 100%;
    padding: 0 10px;
}

.planet-card {
    background: rgba(91, 58, 148, 0.05);
    border-left: 4px solid var(--accent-color);
    padding: 12px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.planet-card:hover {
    background: rgba(91, 58, 148, 0.1);
    transform: translateX(3px);
}

.planet-card h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(91, 58, 148, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* Chat Section Styles */
.tabs {
    display: flex;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
    gap: 5px; /* Add gap between wrapped tabs */
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 15px;
    margin-right: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping within buttons */
    font-family: 'Segoe UI', 'Nirmala UI', Arial, sans-serif; /* For Hindi text in tabs */
    border-radius: 20px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(255, 157, 0, 0.12);
    background: linear-gradient(90deg, #f3f3ff 60%, #ffe6b3 100%);
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 10px;
    background: #f9f9f9;
    overflow: hidden;
    position: relative;
}

#chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    animation: fadeInChat 0.5s;
}

@keyframes fadeInChat {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    align-items: flex-end;
}

.bot-message {
    align-items: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 15px;
    position: relative;
    line-height: 1.5;
    font-size: 1.05rem; /* Slightly larger font for better Hindi readability */
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background-color: #e9e9e9;
    border-bottom-left-radius: 5px;
    color: #333;
    font-family: 'Nirmala UI', 'Segoe UI', Arial, sans-serif; /* Prioritize Nirmala UI for Hindi text */
}

/* New typing indicator styles */
#typing-indicator {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 70px;
    left: 20px;
    background-color: rgba(233, 233, 233, 0.9);
    padding: 8px 15px;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    animation: fadeIn 0.3s;
}

.typing-dot {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.7;
}

.typing-dot:nth-child(1) {
    animation: bounce 1s infinite 0.1s;
}
.typing-dot:nth-child(2) {
    animation: bounce 1s infinite 0.3s;
}
.typing-dot:nth-child(3) {
    animation: bounce 1s infinite 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

#user-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    margin-right: 10px;
    font-size: 1rem;
    font-family: 'Segoe UI', 'Nirmala UI', Arial, sans-serif; /* For Hindi input */
}

#send-btn {
    background: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

#send-btn:hover {
    background: var(--secondary-color);
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    color: var(--light-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    #chart-details {
        grid-template-columns: 1fr;
    }
    
    #chat-messages {
        height: 350px;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .tabs {
        justify-content: center;
    }

    .sign-box {
        min-width: 130px;
        padding: 10px 15px;
    }
    
    .sign-value {
        font-size: 1.2rem;
    }
    
    .accent-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    #chart-details {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .chart-top-section {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .sign-indicators {
        width: auto;
        margin-bottom: 0;
    }
    
    .accent-btn {
        margin: 0;
    }
}

/* Sign Indicators */
.sign-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 5px;
    flex-wrap: wrap;
    width: 100%;
}

.sign-box {
    background: linear-gradient(135deg, rgba(156, 100, 226, 0.1) 0%, rgba(255, 157, 0, 0.05) 100%);
    border: 1px solid rgba(156, 100, 226, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    min-width: 180px;
    flex: 1;
    max-width: 300px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.sign-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.sign-label {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.8;
}

.sign-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--dark-bg);
}

.sign-value i {
    margin-right: 6px;
    color: var(--accent-color);
}

/* Accent Button */
.accent-btn {
    background-color: var(--accent-color);
    padding: 13px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    width: auto;
    margin: 5px auto 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 157, 0, 0.25);
    border-radius: 30px;
}

.accent-btn i {
    margin-right: 8px;
}

.accent-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(255, 157, 0, 0.35);
}

.btn-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}