/* Surya News Panchangam - Styling */

/* ============================================================================
   TELUGU FONT OPTIMIZATION - MUST BE FIRST
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;500;600;700&display=swap');

* {
    font-feature-settings: "liga" 1, "dlig" 1, "ccmp" 1;
    -webkit-font-feature-settings: "liga" 1, "dlig" 1, "ccmp" 1;
}

body {
    font-feature-settings: "liga" 1, "dlig" 1, "ccmp" 1;
    text-rendering: optimizeLegibility;
}

/* CRITICAL: Telugu Heading Fix */
.telugu-heading {
    font-family: 'Noto Sans Telugu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-feature-settings: "liga" 1, "dlig" 1, "ccmp" 1 !important;
    -webkit-font-feature-settings: "liga" 1, "dlig" 1, "ccmp" 1 !important;
    text-rendering: optimizeLegibility !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
}

/* ============================================================================
   HOMEPAGE WIDGET
   ============================================================================ */

.surya-panchangam-widget {
    background: linear-gradient(135deg, #fff5e6 0%, #fff9f0 100%);
    border-left: 5px solid #ff6b35;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.panchangam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0a080;
    padding-bottom: 10px;
}

.panchangam-header h3 {
    margin: 0;
    color: #c41e3a;
    font-size: 1.3em;
    font-weight: 600;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "dlig" 1;
    text-rendering: optimizeLegibility;
    letter-spacing: 0;
    word-spacing: 0;
}

.panchangam-header .view-full {
    color: #ff6b35;
    text-decoration: none;
    font-size: 0.9em;
    padding: 6px 12px;
    border: 1px solid #ff6b35;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.panchangam-header .view-full:hover {
    background-color: #ff6b35;
    color: white;
}

.panchangam-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.panchangam-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #e0c9b8;
    font-size: 0.95em;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.panchangam-row .label {
    font-weight: 600;
    color: #333;
    min-width: 100px;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "dlig" 1;
}

.panchangam-row .value {
    color: #c41e3a;
    font-weight: 500;
    text-align: right;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "dlig" 1;
}

/* ============================================================================
   FULL PAGE DISPLAY
   ============================================================================ */

.surya-panchangam-page {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.panchangam-container {
    background: #fafafa;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.panchangam-container h1 {
    text-align: center;
    color: #c41e3a;
    font-size: 2.2em;
    margin-bottom: 10px;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "dlig" 1;
    -webkit-font-feature-settings: "liga" 1, "dlig" 1;
    text-rendering: optimizeLegibility;
    letter-spacing: 0;
    word-spacing: 0;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.surya-panchangam-page h1 {
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "dlig" 1;
    -webkit-font-feature-settings: "liga" 1, "dlig" 1;
}

.panchangam-date {
    text-align: center;
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

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

.panchangam-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.panchangam-section h3 {
    color: #c41e3a;
    font-size: 1.1em;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #fff5e6;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "dlig" 1;
    text-rendering: optimizeLegibility;
}

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dotted #e8e8e8;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.field-label {
    font-weight: 600;
    color: #333;
    flex: 0 0 50%;
    font-size: 0.95em;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "dlig" 1;
}

.field-value {
    color: #ff6b35;
    font-weight: 500;
    text-align: right;
    flex: 0 0 50%;
    font-family: 'Noto Sans Telugu', 'Segoe UI', sans-serif;
    font-feature-settings: "liga" 1, "dlig" 1;
}

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

.panchangam-error {
    background-color: #fee;
    border-left: 4px solid #c41e3a;
    padding: 15px;
    border-radius: 4px;
    color: #333;
    font-size: 0.95em;
}

.panchangam-error strong {
    color: #c41e3a;
}

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

@media (max-width: 768px) {
    .panchangam-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .panchangam-header .view-full {
        width: 100%;
        text-align: center;
    }

    .panchangam-summary {
        grid-template-columns: 1fr;
    }

    .panchangam-container {
        padding: 15px;
    }

    .panchangam-container h1 {
        font-size: 1.8em;
    }

    .panchangam-grid {
        grid-template-columns: 1fr;
    }

    .panchangam-section {
        padding: 15px;
    }
}

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

@media print {
    .panchangam-header .view-full {
        display: none;
    }

    .panchangam-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .panchangam-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .surya-panchangam-widget {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-left-color: #ff9966;
    }

    .panchangam-header h3 {
        color: #ff9966;
    }

    .panchangam-summary .value {
        color: #ff9966;
    }

    .panchangam-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .panchangam-container h1 {
        color: #ff9966;
    }

    .panchangam-section {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .panchangam-section h3 {
        color: #ff9966;
    }

    .field-label {
        color: #e0e0e0;
    }

    .field-value {
        color: #ffb399;
    }
}