:root {
    --primary-color: #333;
    --secondary-color: #555;
    --accent-color: #000;
    --bg-color: #fff;
    --text-color: #000;
    --card-bg: #fff;
    --house-border: #000;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: #ffffff;
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
}

.main-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

header {
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #000;
    margin-bottom: 10px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #eee;
    box-shadow: none;
}

.card:hover {
    transform: none;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-row {
    display: flex;
    gap: 20px;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #000;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

input:focus {
    border-color: #000;
    outline: none;
}

.btn-generate {
    background: #000;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.btn-generate:hover {
    opacity: 0.8;
}

/* Place Suggestions */
.relative {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #000;
    border-radius: 0;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    text-align: left;
}

.suggestions-list div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestions-list div:hover {
    background: #f0f0f0;
}

/* Results Section */
.hidden {
    display: none;
}

.charts-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.chart-box {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.user-details {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #444;
}

/* Table Styles */
.table-container {
    margin-top: 30px;
    width: 100%;
}

.table-container h3 {
    margin-bottom: 15px;
    color: #000;
}

#planet-table,
#dasha-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#planet-table th,
#planet-table td,
#dasha-table th,
#dasha-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#planet-table th,
#dasha-table th {
    background-color: #f8f8f8;
    color: #333;
    font-weight: 600;
}

/* North Indian Chart CSS */
.chart-display {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    /* Square Aspect Ratio */
    border: 1px solid #000;
    background: #fff;
}

.north-indian-chart {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Drawing Lines */
.north-indian-chart::before {
    /* The X Trace */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to top right, transparent calc(50% - 0.5px), #000 calc(50% - 0.5px), #000 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(to bottom right, transparent calc(50% - 0.5px), #000 calc(50% - 0.5px), #000 calc(50% + 0.5px), transparent calc(50% + 0.5px));
    z-index: 0;
}

.north-indian-chart::after {
    /* Simplification: removed previous attempts at drawing diamond via complex CSS. Using SVG background primarily now. */
    content: none;
}


/* Let's use a background image for the grid lines for perfect rendering */
.north-indian-chart {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><rect x="0" y="0" width="100" height="100" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="100" y2="100" stroke="black" stroke-width="1"/><line x1="100" y1="0" x2="0" y2="100" stroke="black" stroke-width="1"/><line x1="50" y1="0" x2="100" y2="50" stroke="black" stroke-width="1"/><line x1="100" y1="50" x2="50" y2="100" stroke="black" stroke-width="1"/><line x1="50" y1="100" x2="0" y2="50" stroke="black" stroke-width="1"/><line x1="0" y1="50" x2="50" y2="0" stroke="black" stroke-width="1"/></svg>');
    background-size: cover;
}

.house {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    color: #000;
    padding: 2px;
    z-index: 1;
}

/* Highlight House 1 (Lagna House Position) */
.house-1 {
    /* Subtle highlight - maybe just text color or bold */
    font-weight: 800;
    /* Optional: Slight tint for the diamond area? No, impossible with square div. */
    /* Just text highlight */
    color: #cf0000;
    /* Subtle Red highlight for Lagna */
}

/* Text Wrapping and Overflow handling */
.house span {
    font-size: 0.65rem;
    line-height: 1.1;
    display: block;
}

/* Positioning Houses (Fixed Template for North Indian) varies by House Num 1-12 */
/* 
   H1: Top Center Diamond
   H2: Top Left Triangle
   H3: Left Top Triangle
   H4: Left Center Diamond
   H5: Left Bottom Triangle
   H6: Bottom Left Triangle
   H7: Bottom Center Diamond
   H8: Bottom Right Triangle
   H9: Right Bottom Triangle
   H10: Right Center Diamond
   H11: Right Top Triangle
   H12: Top Right Triangle
*/

/* Approximate Centroids */
.house-1 {
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
}

.house-2 {
    top: 10%;
    left: 25%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-3 {
    top: 25%;
    left: 10%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-4 {
    top: 50%;
    left: 20%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
}

.house-5 {
    top: 75%;
    left: 10%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-6 {
    top: 90%;
    left: 25%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-7 {
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
}

.house-8 {
    top: 90%;
    left: 75%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-9 {
    top: 75%;
    left: 90%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-10 {
    top: 50%;
    left: 80%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
}

.house-11 {
    top: 25%;
    left: 90%;
    transform: translate(-50%, -50%);
    width: 25%;
}

.house-12 {
    top: 10%;
    left: 75%;
    transform: translate(-50%, -50%);
    width: 25%;
}

/* Mobile Adjust */
@media (max-width: 600px) {
    .house {
        font-size: 0.6rem;
    }

    .house span {
        font-size: 0.55rem;
    }
}

.sign-number {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 0.6rem;
    color: #999;
    font-weight: normal;
}

/* --------------------------------------------------------------------------
   MODERN CHAT UI
   -------------------------------------------------------------------------- */

/* Animated Chat Toggle Button (FAB style) */
#chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #000 0%, #333 100%);
    color: white;
    font-size: 1.5rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInScale 0.5s ease-out;
}

#chat-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#chat-toggle-btn.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* Chat Widget Container */
#chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#chat-widget.hidden {
    display: none;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #000 0%, #222 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#chat-close-btn:hover {
    opacity: 1;
}

/* Chat Messages Area */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: #000;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
}

/* Strong Text inside messages */
.message strong {
    font-weight: 700;
}

/* Chat Input Area */
.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #000;
    outline: none;
}

#chat-send-btn {
    background: #000;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-size: 0.9rem;
}

#chat-send-btn:hover {
    transform: scale(1.05);
    background: #333;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Special styling for Analysis Results in Chat */
.message.bot ul {
    margin-left: 20px;
    margin-top: 5px;
}

.message.bot li {
    margin-bottom: 5px;
}