/* Hebrew Parasha & Shabbat Times Plugin - Frontend Styles */

/* Main container */
.hps-display {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #333333;
}

/* Font sizes */
.hps-font-small { font-size: 14px; }
.hps-font-medium { font-size: 16px; }
.hps-font-large { font-size: 18px; }
.hps-font-x-large { font-size: 20px; }

/* Card style */
.hps-style-card {
    padding: 20px;
}

.hps-style-card .hps-section-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.hps-style-card .hps-section-title {
    margin: 0;
    font-size: 1.4em;
    font-weight: bold;
    color: #007cba;
}

.hps-style-card .hps-city-name {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* List style */
.hps-style-list {
    padding: 15px;
}

.hps-style-list .hps-section-title {
    font-size: 1.2em;
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #333;
}

.hps-style-list .hps-parasha-section,
.hps-style-list .hps-shabbat-section {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
}

/* Minimal style */
.hps-style-minimal {
    padding: 10px 15px;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.hps-style-minimal .hps-parasha-minimal,
.hps-style-minimal .hps-shabbat-minimal {
    display: inline-block;
    margin-left: 20px;
    font-size: 0.95em;
}

.hps-style-minimal .hps-time-minimal {
    margin-left: 15px;
}

/* Parasha section */
.hps-parasha-section {
    margin-bottom: 20px;
}

.hps-parasha-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hps-parasha-english {
    font-size: 1.1em;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 8px;
}

.hps-parasha-date {
    font-size: 0.9em;
    color: #95a5a6;
}

.hps-parasha-label {
    font-weight: bold;
    color: #34495e;
}

/* Shabbat times section */
.hps-shabbat-section {
    margin-bottom: 15px;
}

.hps-times-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hps-time-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    border-right: 4px solid #3498db;
    transition: all 0.3s ease;
}

.hps-time-item:hover {
    background-color: rgba(255, 255, 255, 0.95);
    transform: translateX(-2px);
}

.hps-candle-lighting {
    border-right-color: #f39c12;
}

.hps-havdalah {
    border-right-color: #9b59b6;
}

.hps-time-icon {
    font-size: 1.5em;
    margin-left: 12px;
    min-width: 30px;
    text-align: center;
}

.hps-time-details {
    flex: 1;
}

.hps-time-label {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 2px;
}

.hps-time-value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
    color: #e74c3c;
    direction: ltr;
    text-align: right;
}

/* Custom title */
.hps-custom-title {
    margin: 0 0 20px 0;
    font-size: 1.6em;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
}

/* Footer */
.hps-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.hps-last-updated {
    color: #95a5a6;
    font-size: 0.85em;
}

/* Error handling */
.hps-error {
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.hps-error-icon {
    font-size: 1.5em;
    margin-left: 10px;
    color: #e74c3c;
}

.hps-error-message {
    flex: 1;
    color: #c0392b;
}

.hps-error-message strong {
    display: block;
    margin-bottom: 5px;
}

/* Widget specific styles */
.hps-widget {
    font-size: 14px;
}

.hps-widget .hps-parasha-name {
    font-size: 1.4em;
}

.hps-widget .hps-time-value {
    font-size: 1.1em;
}

.hps-widget .hps-custom-title {
    font-size: 1.3em;
    margin-bottom: 15px;
}

/* Responsive design */
@media (max-width: 768px) {
    .hps-display {
        margin: 10px 0;
        border-radius: 5px;
    }
    
    .hps-style-card {
        padding: 15px;
    }
    
    .hps-parasha-name {
        font-size: 1.5em;
    }
    
    .hps-time-item {
        padding: 10px;
    }
    
    .hps-times-container {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .hps-style-card {
        padding: 12px;
    }
    
    .hps-parasha-name {
        font-size: 1.3em;
    }
    
    .hps-time-icon {
        font-size: 1.2em;
        margin-left: 8px;
        min-width: 25px;
    }
    
    .hps-time-value {
        font-size: 1.1em;
    }
}

/* RTL improvements */
[dir="rtl"] .hps-display {
    text-align: right;
}

[dir="rtl"] .hps-time-value {
    direction: ltr;
    text-align: right;
}

/* Animation for loading states */
.hps-loading {
    position: relative;
    opacity: 0.7;
}

.hps-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    width: 20px;
    height: 20px;
    margin: -10px -10px 0 0;
    border: 2px solid #3498db;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: hps-spin 1s linear infinite;
}

@keyframes hps-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Multi-city layout styles */
.hps-multi-city-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
    margin: 20px 0;
}

.hps-multi-title {
    text-align: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
}

.hps-multi-parasha-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border: 2px solid #3498db;
}

.hps-parasha-title {
    font-size: 1.6em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.hps-parasha-english {
    font-size: 1.1em;
    color: #7f8c8d;
    font-style: italic;
    margin: 0;
}

/* Grid layout */
.hps-cities-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.hps-columns-1 { grid-template-columns: 1fr; }
.hps-columns-2 { grid-template-columns: repeat(2, 1fr); }
.hps-columns-3 { grid-template-columns: repeat(3, 1fr); }
.hps-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* City cards */
.hps-city-card {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hps-city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.hps-city-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.hps-city-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.hps-city-times {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hps-time-row {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    border-right: 3px solid #3498db;
}

.hps-time-icon {
    font-size: 1.2em;
    margin-left: 8px;
    min-width: 25px;
    text-align: center;
}

.hps-time-label {
    flex: 1;
    font-weight: bold;
    color: #34495e;
}

.hps-time-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #e74c3c;
    direction: ltr;
    text-align: right;
}

.hps-city-error {
    text-align: center;
    color: #e74c3c;
    font-style: italic;
    padding: 10px;
}

.hps-multi-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    color: #95a5a6;
    font-size: 0.85em;
}

/* Responsive design for multi-city */
@media (max-width: 768px) {
    .hps-columns-2,
    .hps-columns-3,
    .hps-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .hps-cities-grid {
        gap: 15px;
    }
    
    .hps-city-card {
        padding: 12px;
    }
    
    .hps-city-name {
        font-size: 1.2em;
    }
}

@media (max-width: 1024px) {
    .hps-columns-3,
    .hps-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Compact style - ultra-minimalist for sidebars */
.hps-style-compact {
    padding: 8px 12px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    margin: 5px 0;
    font-size: 13px;
}

.hps-style-compact .hps-section-title {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 5px 0;
    color: #333;
    text-align: center;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

.hps-style-compact .hps-city-name {
    font-size: 11px;
    color: #666;
    text-align: center;
    margin: 0 0 5px 0;
}

.hps-style-compact .hps-shabbat-section {
    margin-bottom: 0;
}

.hps-style-compact .hps-times-container {
    display: block;
    gap: 3px;
}

.hps-style-compact .hps-time-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 6px;
    margin-bottom: 2px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
    border: none;
    transition: none;
    font-size: 12px;
}

.hps-style-compact .hps-time-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: none;
}

.hps-style-compact .hps-time-icon {
    font-size: 12px;
    margin-left: 4px;
    min-width: 15px;
    text-align: center;
}

.hps-style-compact .hps-time-details {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hps-style-compact .hps-time-label {
    display: inline;
    font-weight: normal;
    font-size: 12px;
    color: #555;
    margin-bottom: 0;
    margin-left: 3px;
}

.hps-style-compact .hps-time-value {
    display: inline;
    font-size: 12px;
    font-weight: bold;
    color: var(--hps-time-value-color, #d63638);
    direction: ltr;
    text-align: left;
}

.hps-style-compact .hps-parasha-section {
    margin-bottom: 8px;
    text-align: center;
}

.hps-style-compact .hps-parasha-name {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin: 2px 0;
    text-shadow: none;
}

.hps-style-compact .hps-parasha-english {
    font-size: 11px;
    color: #777;
    font-style: italic;
    margin-bottom: 3px;
}

/* Even more compact variant */
.hps-style-ultra-compact {
    padding: 4px 8px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    margin: 2px 0;
    font-size: 11px;
}

.hps-style-ultra-compact .hps-section-title {
    display: none; /* Hide title for ultra-compact */
}

.hps-style-ultra-compact .hps-city-name {
    font-size: 10px;
    color: #666;
    text-align: center;
    margin: 0 0 3px 0;
}

.hps-style-ultra-compact .hps-shabbat-section,
.hps-style-ultra-compact .hps-parasha-section {
    margin-bottom: 0;
}

.hps-style-ultra-compact .hps-times-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
}

.hps-style-ultra-compact .hps-time-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 4px;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    border: none;
    font-size: 10px;
    flex: 1;
    justify-content: center;
}

.hps-style-ultra-compact .hps-time-icon {
    font-size: 10px;
    margin-left: 2px;
    min-width: 12px;
}

.hps-style-ultra-compact .hps-time-details {
    display: contents;
}

.hps-style-ultra-compact .hps-time-label {
    display: none; /* Hide labels for ultra-compact */
}

.hps-style-ultra-compact .hps-time-value {
    font-size: 10px;
    font-weight: bold;
    color: var(--hps-time-value-color, #d63638);
    direction: ltr;
}

.hps-style-ultra-compact .hps-parasha-name {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    margin: 0 0 2px 0;
    text-align: center;
}

.hps-style-ultra-compact .hps-parasha-english {
    display: none; /* Hide English name for ultra-compact */
}

/* Responsive adjustments for compact styles */
@media (max-width: 480px) {
    .hps-style-compact {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .hps-style-compact .hps-time-item {
        font-size: 11px;
    }
    
    .hps-style-ultra-compact {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Print styles */
@media print {
    .hps-display {
        box-shadow: none;
        border: 1px solid #ccc;
        background-color: white !important;
        color: black !important;
    }
    
    .hps-time-item {
        background-color: #f9f9f9 !important;
    }
    
    .hps-error {
        background-color: #f0f0f0 !important;
        border: 1px solid #ccc !important;
    }
    
    .hps-multi-city-container {
        background-color: white !important;
        color: black !important;
    }
    
    .hps-city-card {
        background-color: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
