/* =============================================================================
   Tamilcube Panchangam — Stylesheet
   Colour palette: orange (#FF7A3D / #FF5100), cream (#F8F5F4), dark brown (#1E1810)
   ============================================================================= */

/* --- Reset & wrapper -------------------------------------------------------- */
.tcp-wrapper {
    font-family: 'Open Sans', 'Noto Sans Tamil', Arial, sans-serif;
    font-size: 15px;
    color: #1E1810;
    background: #F8F5F4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    margin: 1.5rem 0;
}

/* --- Form ------------------------------------------------------------------- */
.tcp-form-wrap {
    background: #fff;
    padding: 1.5rem 2rem;
    border-bottom: 3px solid #FF7A3D;
}

.tcp-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tcp-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tcp-form-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 180px;
    gap: 0.3rem;
}

.tcp-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #575250;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tcp-input,
.tcp-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #1E1810;
    background: #fff;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.tcp-input:focus,
.tcp-select:focus {
    outline: none;
    border-color: #FF7A3D;
    box-shadow: 0 0 0 3px rgba(255,122,61,0.15);
}

.tcp-manual-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #ddd;
}

.tcp-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 0.25rem;
}

.tcp-btn {
    padding: 0.55rem 1.4rem;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tcp-btn-primary {
    background: linear-gradient(135deg, #FF7A3D, #FF5100);
    color: #fff;
    border-color: #FF5100;
}

.tcp-btn-primary:hover {
    background: linear-gradient(135deg, #FF5100, #e04500);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,81,0,0.35);
}

.tcp-btn-outline {
    background: transparent;
    color: #FF5100;
    border-color: #FF7A3D;
}

.tcp-btn-outline:hover,
.tcp-btn-outline.active {
    background: #FFF0E8;
}

/* --- Loading / Error ------------------------------------------------------- */
.tcp-loading,
.tcp-error {
    padding: 2rem;
    text-align: center;
    font-size: 1rem;
}

.tcp-loading {
    color: #FF5100;
    animation: tcp-pulse 1.2s ease-in-out infinite;
}

@keyframes tcp-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.tcp-error {
    color: #c0392b;
    background: #fdecea;
    border-left: 4px solid #c0392b;
}

/* --- Output container ------------------------------------------------------- */
.tcp-panchangam-output {
    display: flex;
    flex-direction: column;
}

/* --- Section header -------------------------------------------------------- */
.tcp-section-header {
    background: linear-gradient(135deg, #FF7A3D, #FF5100);
    color: #fff;
    padding: 0.65rem 1.5rem;
}

.tcp-section-header.tcp-section-auspicious {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.tcp-section-header.tcp-section-inauspicious {
    background: linear-gradient(135deg, #8e44ad, #6c3483);
}

.tcp-section-title {
    margin: 0;
    font-family: 'Poppins', 'Noto Sans Tamil', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* --- Section body ---------------------------------------------------------- */
.tcp-section-body {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F0EBE8;
}

/* --- Panchangam grid (2-column on wide screens) ----------------------------- */
.tcp-panchang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.6rem 1.5rem;
}

.tcp-panchang-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px dotted #ede8e4;
}

.tcp-panchang-row:last-child {
    border-bottom: none;
}

.tcp-panchang-icon {
    font-size: 1.3rem;
    min-width: 28px;
    text-align: center;
    margin-top: 2px;
}

.tcp-panchang-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tcp-panchang-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #575250;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tcp-panchang-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1E1810;
    margin-top: 1px;
}

.tcp-panchang-value-ta {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FF5100;
    margin-top: 1px;
}

.tcp-label-ta {
    font-weight: 600;
    opacity: 0.75;
    font-size: 0.92em;
}

.tcp-section-title-ta {
    font-weight: 600;
    opacity: 0.85;
    font-size: 0.9em;
}

.tcp-tdb-month-ta,
.tcp-tdb-year-ta {
    opacity: 0.85;
    font-size: 0.9em;
}

.tcp-panchang-sub {
    font-size: 0.82rem;
    color: #888;
    margin-top: 2px;
}

.tcp-panchang-endtime {
    font-size: 0.80rem;
    color: #FF5100;
    margin-top: 3px;
    font-weight: 600;
}

/* --- Sun timings ----------------------------------------------------------- */
.tcp-sun-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.tcp-sun-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 160px;
}

.tcp-sun-icon {
    font-size: 1.6rem;
}

.tcp-sun-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #575250;
    text-transform: uppercase;
    display: block;
    line-height: 1.2;
}

.tcp-sun-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #FF5100;
    display: block;
    margin-top: 1px;
}

.tcp-sun-item {
    flex-direction: column;
    align-items: flex-start;
}

/* --- Timing rows (Nalla Neram, Rahu Kalam, etc.) --------------------------- */
.tcp-timing-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px dotted #ede8e4;
}

.tcp-timing-row:last-child {
    border-bottom: none;
}

.tcp-timing-icon {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
    margin-top: 3px;
}

.tcp-timing-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tcp-timing-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #575250;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tcp-timing-slots {
    font-size: 1rem;
    font-weight: 700;
    color: #1E1810;
    margin-top: 2px;
}

.tcp-timing-slot {
    font-size: 1rem;
    font-weight: 700;
    color: #1E1810;
    margin-top: 2px;
}

/* Auspicious slots — green tint */
.tcp-timing-nalla .tcp-timing-slots,
.tcp-timing-nalla .tcp-timing-slot,
.tcp-timing-gowri .tcp-timing-slots,
.tcp-timing-gowri .tcp-timing-slot {
    color: #1e8449;
}

/* Sulam */
.tcp-sulam-ta {
    color: #888;
    font-size: 0.92em;
}

.tcp-sulam-remedy {
    font-size: 0.88rem;
    color: #8e44ad;
    font-weight: 600;
}

/* --- Responsive ------------------------------------------------------------- */
@media (max-width: 768px) {
    .tcp-form-wrap {
        padding: 1rem;
    }
    .tcp-section-body {
        padding: 0.85rem 1rem;
    }
    .tcp-panchang-grid {
        grid-template-columns: 1fr;
    }
    .tcp-sun-row {
        gap: 1.25rem;
    }
}

@media (max-width: 544px) {
    .tcp-form-row {
        flex-direction: column;
    }
    .tcp-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .tcp-btn {
        text-align: center;
    }
}

/* --- Tamil date bar --------------------------------------------------------- */
.tcp-tamil-date-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #FF7A3D, #FF5100);
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-family: 'Poppins', 'Noto Sans Tamil', Arial, sans-serif;
}

.tcp-tdb-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
    flex-shrink: 0;
}

.tcp-tdb-month-day {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.tcp-tdb-year {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    margin-left: auto;
}

/* --- Daily calendar sheet -------------------------------------------------- */
.tcp-calendar-sheet-wrap {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F0EBE8;
    text-align: center;
}

.tcp-calendar-sheet-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    display: block;
    margin: 0 auto;
}

.tcp-sheet-not-found {
    color: #999;
    font-size: 0.88rem;
    font-style: italic;
    padding: 1rem 0;
    margin: 0;
}

/* --- Print ------------------------------------------------------------------ */
@media print {
    .tcp-form-wrap,
    .tcp-btn {
        display: none !important;
    }
    .tcp-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .tcp-section-header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
