/**
 * Tamilcube Panchangam Styles
 * Complete standalone CSS
 * 
 * @package TamilcubeHoroscope
 * @version 1.0.0
 */

/* ========================================
   PANCHANGAM SECTION - BASE STYLES
   ======================================== */

.tch-panchangam-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tch-panchangam-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
}

/* ========================================
   HEADER
   ======================================== */

.tch-panchangam-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tch-panchangam-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tch-title-native {
    font-size: 24px;
    font-weight: 600;
}

.tch-panchangam-subtitle {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* ========================================
   CARD LAYOUT (DEFAULT)
   ======================================== */

.tch-panchangam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tch-panchang-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tch-panchang-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.tch-panchang-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.tch-panchang-card:hover::before {
    width: 8px;
}

.tch-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
    text-align: center;
}

.tch-card-content {
    text-align: center;
}

.tch-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    margin-bottom: 8px;
}

.tch-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tch-value-native {
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    display: inline-block;
    margin-top: 4px;
}

.tch-card-sub {
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
}

.tch-card-time {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #a0aec0;
    line-height: 1.6;
}

.tch-time-start,
.tch-time-end {
    font-weight: 600;
    color: #4a5568;
}

.tch-time-to {
    color: #a0aec0;
    font-style: italic;
    padding: 0 4px;
}

/* Specific card colors */
.tch-card-var {
    border-top: 3px solid #3182ce;
}

.tch-card-tithi {
    border-top: 3px solid #805ad5;
}

.tch-card-nakshatra {
    border-top: 3px solid #d69e2e;
}

.tch-card-yoga {
    border-top: 3px solid #38a169;
}

.tch-card-karana {
    border-top: 3px solid #e53e3e;
}

.tch-card-paksha {
    border-top: 3px solid #ed64a6;
}

.tch-card-sunrise {
    border-top: 3px solid #dd6b20;
}

.tch-card-sunset {
    border-top: 3px solid #4299e1;
}

/* ========================================
   COMPACT LAYOUT
   ======================================== */

.tch-panchangam-compact {
    max-width: 800px;
    margin: 20px auto;
}

.tch-panchangam-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tch-panchangam-table tr {
    border-bottom: 1px solid #e2e8f0;
}

.tch-panchangam-table tr:last-child {
    border-bottom: none;
}

.tch-panchangam-table td {
    padding: 16px 20px;
}

.tch-panchangam-table .tch-label {
    font-weight: 600;
    color: #4a5568;
    width: 35%;
    background: #f7fafc;
}

.tch-panchangam-table .tch-value {
    color: #2d3748;
    font-weight: 500;
}

/* ========================================
   TRADITIONAL LAYOUT
   ======================================== */

.tch-panchangam-traditional {
    max-width: 900px;
    margin: 20px auto;
}

.tch-panchangam-table-traditional {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid #2d3748;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.tch-panchangam-table-traditional tr {
    border-bottom: 1px solid #cbd5e0;
}

.tch-panchangam-table-traditional tr:last-child {
    border-bottom: none;
}

.tch-panchangam-table-traditional td {
    padding: 16px 20px;
    border-right: 1px solid #cbd5e0;
}

.tch-panchangam-table-traditional td:last-child {
    border-right: none;
}

.tch-cell-label {
    font-weight: 700;
    color: #2d3748;
    background: #edf2f7;
    width: 25%;
    text-align: right;
    padding-right: 24px;
}

.tch-cell-value {
    color: #4a5568;
    font-weight: 500;
}

/* ========================================
   PANCHANGAM FORM STYLES
   ======================================== */

#tch-panchangam-form {
    max-width: 800px;
    margin: 0 auto 30px;
}

#tch-panchangam-manual-coords {
    animation: slideDown 0.3s ease;
}

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

#tch-panchangam-manual-toggle.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .tch-panchangam-grid {
        grid-template-columns: 1fr;
    }
    
    .tch-panchangam-title {
        font-size: 22px;
    }
    
    .tch-panchang-card {
        padding: 16px;
    }
    
    .tch-card-value {
        font-size: 16px;
    }
    
    .tch-panchangam-table td,
    .tch-panchangam-table-traditional td {
        padding: 12px 16px;
    }
    
    .tch-cell-label {
        text-align: left;
        display: block;
        padding-right: 16px;
    }
}

@media (max-width: 480px) {
    .tch-panchangam-wrapper {
        padding: 10px;
    }
    
    .tch-panchangam-section {
        padding: 20px 15px;
    }
    
    .tch-panchangam-header {
        margin-bottom: 20px;
    }
    
    .tch-panchangam-title {
        font-size: 20px;
    }
    
    .tch-card-icon {
        font-size: 28px;
    }
    
    .tch-card-value {
        font-size: 15px;
    }
    
    .tch-value-native {
        font-size: 14px;
    }
}

/* ========================================
   DARK THEME
   ======================================== */

.tch-panchangam-wrapper[data-theme="dark"] {
    background: #1a202c;
    color: #e2e8f0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-section {
    background: #2d3748;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-header {
    border-bottom-color: #4a5568;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-title {
    color: #e2e8f0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-subtitle {
    color: #a0aec0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchang-card {
    background: #1a202c;
    border-color: #4a5568;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-card-label {
    color: #a0aec0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-card-value {
    color: #e2e8f0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-value-native {
    color: #cbd5e0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-card-sub {
    color: #a0aec0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-card-time {
    border-top-color: #4a5568;
    color: #718096;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-time-start,
.tch-panchangam-wrapper[data-theme="dark"] .tch-time-end {
    color: #cbd5e0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-table {
    background: #2d3748;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-table tr {
    border-bottom-color: #4a5568;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-table .tch-label {
    color: #cbd5e0;
    background: #1a202c;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-table .tch-value {
    color: #e2e8f0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-panchangam-table-traditional {
    background: #2d3748;
    border-color: #4a5568;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-cell-label {
    background: #1a202c;
    color: #e2e8f0;
}

.tch-panchangam-wrapper[data-theme="dark"] .tch-cell-value {
    color: #cbd5e0;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .tch-panchangam-wrapper {
        max-width: 100%;
        padding: 0;
    }
    
    .tch-panchangam-section {
        box-shadow: none;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .tch-panchangam-header {
        border-bottom: 2px solid #000;
    }
    
    .tch-panchang-card {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .tch-panchang-card::before {
        display: none;
    }
    
    .tch-form {
        display: none !important;
    }
    
    .tch-panchangam-table,
    .tch-panchangam-table-traditional {
        border-color: #000 !important;
    }
    
    .tch-panchangam-table tr,
    .tch-panchangam-table-traditional tr {
        border-bottom-color: #000 !important;
    }
}

/* ========================================
   LANGUAGE-SPECIFIC FONTS
   ======================================== */

/* Tamil */
.tch-panchangam-wrapper[lang="ta"] {
    font-family: 'Latha', 'Tamil MN', 'Nirmala UI', sans-serif;
}

.tch-panchangam-wrapper[lang="ta"] .tch-value-native,
.tch-panchangam-wrapper[lang="ta"] .tch-title-native {
    font-weight: 600;
    font-size: 95%;
}

/* Hindi */
.tch-panchangam-wrapper[lang="hi"] {
    font-family: 'Mangal', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;
}

.tch-panchangam-wrapper[lang="hi"] .tch-value-native,
.tch-panchangam-wrapper[lang="hi"] .tch-title-native {
    font-weight: 600;
    font-size: 95%;
}

/* Telugu */
.tch-panchangam-wrapper[lang="te"] {
    font-family: 'Gautami', 'Noto Sans Telugu', 'Nirmala UI', sans-serif;
}

.tch-panchangam-wrapper[lang="te"] .tch-value-native,
.tch-panchangam-wrapper[lang="te"] .tch-title-native {
    font-weight: 600;
    font-size: 95%;
}

/* Malayalam */
.tch-panchangam-wrapper[lang="ml"] {
    font-family: 'Kartika', 'Noto Sans Malayalam', 'Nirmala UI', sans-serif;
}

.tch-panchangam-wrapper[lang="ml"] .tch-value-native,
.tch-panchangam-wrapper[lang="ml"] .tch-title-native {
    font-weight: 600;
    font-size: 95%;
}

/* Kannada */
.tch-panchangam-wrapper[lang="kn"] {
    font-family: 'Tunga', 'Noto Sans Kannada', 'Nirmala UI', sans-serif;
}

.tch-panchangam-wrapper[lang="kn"] .tch-value-native,
.tch-panchangam-wrapper[lang="kn"] .tch-title-native {
    font-weight: 600;
    font-size: 95%;
}

/* ========================================
   LOADING STATE
   ======================================== */

.tch-panchangam-loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.tch-panchangam-loading::before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   ERROR STATE
   ======================================== */

.tch-panchangam-error {
    background: #fed7d7;
    color: #c53030;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    margin: 20px 0;
}