/* Reusing site variables from -base.css */

.main {
    /* opacity: 0; Removed to ensure visibility without extra JS */
    /* transition: opacity 1.5s; */
    width: 100%;
    margin: 0 auto;
}

/* HEADERS */
#planetaryHours {
    /* Main title is already handled by h1 in PHP file */
    display: none;
}

h2,
h3 {
    font-family: "Mate", serif;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--title-color);
    border: none;
}

#planetaryRuler {
    display: none;
    font-size: 24px;
    margin: 54px 0 0 0;
    text-align: center;
    border: none;
}

/* FORM */
.form-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-container-medium);
    box-shadow: var(--shadow-small-container);
}

form {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: none;
    background: transparent;
    gap: 32px;
}

.form-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start; /* Changed from center to flex-start */
    gap: 12px;
}

/* INPUTS & SELECTS */
label {
    font-weight: 600;
    min-width: 60px;
    color: var(--title-color);
}

input[type="text"],
select {
    font-family: inherit;
    font-size: 1rem;
    padding: 8px 12px;
    transition: all 0.3s ease;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-container-medium);
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(from var(--primary) r g b / 0.2);
}

select {
    padding-right: 1.5em; /* Space for arrow */
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* BUTTONS */
.button-row {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 16px;
}

button {
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    font-weight: var(--font-weight-buttons, 700);
    padding: 10px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 8px;
}

/* Submit Button - similar to primary generic style */
button[type="submit"] {
    color: var(--on-primary);
    border: 1px solid var(--primary);
    background-color: var(--primary);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    background-color: var(--primary--hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Reset Button */
button.reset-button {
    color: var(--text-faded);
    border: 1px solid var(--border-color);
    background-color: transparent;
}

button.reset-button:hover {
    color: var(--text-color);
    border-color: var(--text-color);
    background-color: var(--bg-container-small);
}

/* AUTOCOMPLETE */
.autocomplete-dropdown {
    position: absolute;
    overflow-y: auto;
    width: 100%;
    max-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 6px 6px;
    background-color: var(--bg-container-medium);
    box-shadow: var(--shadow-small-container);
    z-index: 1000;
}

.twitter-typeahead {
    flex: 1; /* Allow it to take available space instead of forcing 100% width */
    min-width: 200px; /* Ensure it doesn't get too small */
}

.autocomplete-dropdown li,
.tt-suggestion {
    padding: 8px 12px;
    list-style: none;
    cursor: pointer;
    color: var(--text-color);
}

.autocomplete-dropdown li:hover,
.tt-suggestion:hover,
.tt-cursor {
    color: var(--primary);
    background-color: var(--bg-container-small);
}

/* CURRENT HOUR INFO */
#currentHourInfo {
    margin: 40px auto 20px auto;
    text-align: center;
}

#currentHourContent {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: var(--bg-container-medium);
    box-shadow: var(--shadow-small-container);
    gap: 8px;
}

#currentHourPlanet {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

#currentHourTimer {
    font-family: monospace;
    font-size: 1rem;
    color: var(--text-faded);
}

/* HOURS TABLES */
#megaContainer {
    display: none; /* Already hidden by ID logic, but ensuring it here too */
    margin-top: 30px;
}

.large-hours-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.section {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    padding: 0 20px 20px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-container-medium);
    box-shadow: var(--shadow-small-container);
}

.section h3 {
    margin-top: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    text-align: center;
}

.hours-container table {
    width: 100%;
    border-collapse: collapse;
}

.hours-container th {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px;
    text-align: center;
    text-transform: uppercase;
    color: var(--text-faded);
    border-bottom: 1px solid var(--border-color);
}

/* Style for # column cells */
.hours-container td:first-child {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-faded);
}

.hours-container td {
    font-size: 0.95rem;
    padding: 10px;
    text-align: center;
    color: var(--text-color);
    border-bottom: 1px solid rgba(from var(--border-color) r g b / 0.3);
}

.hours-container tr:last-child td {
    border-bottom: none;
}

.hours-container tbody tr {
    transition: background-color 0.2s ease;
}

.hours-container tbody tr:hover {
    background-color: var(--bg-container-small);
}

/* Highlight current hour */
.hours-container tbody tr.current-hour {
    border-left: 3px solid var(--primary);
    background-color: rgba(from var(--primary) r g b / 0.1);
}

.hours-container tbody tr.current-hour td {
    font-weight: 600;
    color: var(--primary);
}

/* ICONS */
.icon-wrap {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.ruler-image {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
    filter: var(--filter-gold); /* Apply gold filter to match theme */
}

tr:hover .ruler-image {
    transform: scale(1.2);
}

.progress-ring-svg {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 30px;
    height: 30px;
    pointer-events: none;
}

.progress-ring-fg {
    stroke: var(--primary);
}

/* Ruler Cell Align */
.ruler-cell {
    display: flex !important; /* Force flex for alignment */
    align-items: center;
    justify-content: flex-start; /* Align left */
    padding-left: 20px !important;
    gap: 8px;
}

.section.day-section {
    background-color: rgba(255, 215, 0, 0.05) !important;
}

.section.night-section {
    background-color: rgba(0, 50, 255, 0.05) !important;
}

/* Stars Container in Content Area */
.content-stars-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Individual star dots */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    animation: flicker var(--flicker-duration, 4s) ease-in-out infinite;
    animation-delay: var(--flicker-delay, 1s);
    opacity: 0.8;
    border-radius: 50%;
    background-color: var(--bold-bright);
}

/* Flickering animation for stars */
@keyframes flicker {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        box-sizing: border-box;
        margin: 20px 0;
        padding: 16px;
    }

    .form-row {
        align-items: stretch;
        flex-direction: column;
    }

    .form-row > * {
        box-sizing: border-box;
        width: 100%;
    }

    .button-row {
        flex-direction: column;
    }

    .large-hours-container {
        align-items: center;
        flex-direction: column;
    }

    .section {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding: 0 12px 12px 12px;
    }

    .hours-container table {
        font-size: 0.9rem;
    }

    .hours-container th,
    .hours-container td {
        padding: 8px 4px;
    }

    .ruler-cell {
        padding-left: 8px !important;
    }

    .ruler-name {
        font-size: 0.9rem;
    }

    #currentHourContent {
        padding: 10px 16px;
    }

    #currentHourPlanet {
        font-size: 1rem;
    }

    #currentHourTimer {
        font-size: 0.9rem;
    }
}
