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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
    width: 100%;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.dropdown-container {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dropdown-container label {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.nakshatra-dropdown {
    flex: 1;
    min-width: 300px;
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

.nakshatra-dropdown:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.nakshatra-dropdown:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.table-container {
    overflow-x: visible;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
}

.table-title {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.info-tables-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.info-table-wrapper {
    display: flex;
    flex-direction: column;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95em;
    table-layout: fixed;
}

.info-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.info-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
}

.info-table tbody tr {
    transition: background-color 0.2s ease;
}

.info-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.info-table tbody tr:hover {
    background-color: #e8e9ff;
}

.info-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.info-table tbody tr:last-child td {
    border-bottom: none;
}

.info-table td:first-child {
    font-weight: 600;
    color: #667eea;
    background-color: #f0f2ff;
    width: 35%;
}

.info-table td:last-child {
    width: 65%;
    color: #555;
}

/* Output table specific styling with color coding */
#output-table td:last-child {
    font-weight: 600;
    text-transform: capitalize;
}

#output-table tbody tr:nth-child(1) td:last-child {
    color: #ff9800; /* Medium - Orange */
}

#output-table tbody tr:nth-child(2) td:last-child {
    color: #4caf50; /* Excellent - Green */
}

#output-table tbody tr:nth-child(3) td:last-child {
    color: #f44336; /* Bad - Red */
}

#output-table tbody tr:nth-child(4) td:last-child {
    color: #4caf50; /* Good - Green */
}

#output-table tbody tr:nth-child(5) td:last-child {
    color: #f44336; /* Bad - Red */
}

#output-table tbody tr:nth-child(6) td:last-child {
    color: #4caf50; /* Good - Green */
}

#output-table tbody tr:nth-child(7) td:last-child {
    color: #d32f2f; /* Very Bad - Dark Red */
}

#output-table tbody tr:nth-child(8) td:last-child {
    color: #4caf50; /* Good - Green */
}

#output-table tbody tr:nth-child(9) td:last-child {
    color: #2e7d32; /* Very Good - Dark Green */
}

.tara-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 1em;
    table-layout: fixed;
}

.tara-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tara-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1.05em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tara-table th:nth-child(1) {
    width: 18%;
}

.tara-table th:nth-child(2),
.tara-table th:nth-child(3),
.tara-table th:nth-child(4) {
    width: 22%;
}

.tara-table th:nth-child(5) {
    width: 16%;
}

.tara-table tbody tr {
    transition: background-color 0.2s ease;
}

.tara-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.tara-table tbody tr:hover {
    background-color: #e8e9ff;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tara-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.tara-table tbody tr:last-child td {
    border-bottom: none;
}

.tara-table td:first-child {
    font-weight: 600;
    color: #667eea;
    background-color: #f0f2ff;
}

.tara-table td:nth-child(2),
.tara-table td:nth-child(3),
.tara-table td:nth-child(4) {
    color: #555;
    font-weight: 500;
}

.tara-table td:last-child {
    font-weight: 600;
    color: #764ba2;
    text-transform: capitalize;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 15px;
        border-radius: 15px;
    }

    header {
        margin-bottom: 25px;
        padding-bottom: 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .dropdown-container {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 20px;
    }

    .dropdown-container label {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .nakshatra-dropdown {
        min-width: 100%;
        font-size: 0.95em;
        padding: 10px 15px;
        padding-right: 40px;
    }

    .info-tables-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 20px;
        margin-bottom: 30px;
    }

    .table-title {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .table-container {
        margin-bottom: 20px;
    }

    .tara-table {
        font-size: 0.65em;
    }

    .info-table {
        font-size: 0.75em;
    }

    .tara-table th {
        padding: 6px 4px;
        font-size: 0.7em;
        letter-spacing: 0.2px;
        line-height: 1.2;
    }

    .tara-table td {
        padding: 6px 4px;
        font-size: 0.65em;
        line-height: 1.3;
    }

    .info-table th {
        padding: 6px 4px;
        font-size: 0.75em;
        letter-spacing: 0.2px;
        line-height: 1.2;
    }

    .info-table td {
        padding: 6px 4px;
        font-size: 0.75em;
        line-height: 1.3;
    }

    .info-table td:first-child {
        width: 40%;
    }

    .info-table td:last-child {
        width: 60%;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    body {
        padding: 3px;
    }

    .container {
        padding: 10px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.2em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .table-title {
        font-size: 1em;
    }

    .tara-table {
        font-size: 0.6em;
    }

    .info-table {
        font-size: 0.7em;
    }

    .tara-table th,
    .tara-table td {
        padding: 5px 3px;
    }

    .info-table th,
    .info-table td {
        padding: 5px 3px;
    }

    .tara-table th {
        font-size: 0.65em;
        line-height: 1.1;
    }

    .tara-table td {
        font-size: 0.6em;
        line-height: 1.2;
    }

    .info-table th {
        font-size: 0.7em;
        line-height: 1.1;
    }

    .info-table td {
        font-size: 0.7em;
        line-height: 1.2;
    }

    .tara-table th:nth-child(1) {
        width: 22%;
    }

    .tara-table th:nth-child(2),
    .tara-table th:nth-child(3),
    .tara-table th:nth-child(4) {
        width: 19%;
    }

    .tara-table th:nth-child(5) {
        width: 21%;
    }

    .tara-table td:nth-child(2),
    .tara-table td:nth-child(3),
    .tara-table td:nth-child(4) {
        font-size: 0.55em;
    }
}

/* Very small devices (360px and below) */
@media (max-width: 360px) {
    .container {
        padding: 8px;
    }

    header h1 {
        font-size: 1.1em;
    }

    .subtitle {
        font-size: 0.8em;
    }

    .table-title {
        font-size: 0.9em;
    }

    .tara-table {
        font-size: 0.55em;
    }

    .info-table {
        font-size: 0.65em;
    }

    .tara-table th,
    .tara-table td {
        padding: 4px 2px;
    }

    .info-table th,
    .info-table td {
        padding: 4px 2px;
    }

    .tara-table th {
        font-size: 0.6em;
    }

    .tara-table td {
        font-size: 0.55em;
    }

    .tara-table td:nth-child(2),
    .tara-table td:nth-child(3),
    .tara-table td:nth-child(4) {
        font-size: 0.5em;
    }

    .info-table th {
        font-size: 0.65em;
    }

    .info-table td {
        font-size: 0.65em;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

