/* General Body Styles */

h2 {
    font-size: 28px;
    color: var(--secondary-color);
    text-align: center;
    margin: 30px 0 20px;
}

h3 {
    font-size: 28px;
    color: var(--secondary-color);
    margin-bottom: 20px;
    text-align: center;
}

.planet-description {
    font-size: 16px; /* Ensure consistent font size */
    text-align: center; /* As per previous request */
}
:root {
    --primary-color: #0d8044;
    --secondary-color: #d4af37;
    --accent-color: #105c2f;
    --dark-bg: #0a3b27;
    --light-bg: #f8f7f1;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-dark: #033018;
    --text-light: #fffaf0;
    --gold-light: #f0e68c;
    --border-radius: 12px;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease-in-out;
}

body {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg), #072315);
    color: var(--text-light);
    line-height: 1.6;
    padding: 20px;
    overflow-x: hidden;
}

/* Ultra-smooth scrolling and touch optimization for mobile */
body {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    backface-visibility: hidden;
}

.subtitle {
    font-size: 35px;
    text-align: center;
    color: var(--gold-light);
    margin: 20px 0;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: rgba(13, 59, 39, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.header h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 60px;
    color: var(--secondary-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: bold;
}

.select-container label {
    font-size: 24px;
    color: var(--gold-light);
    margin-bottom: 8px; /* Add some space below the label */
    display: block; /* Ensure label is on its own line */
}

.select-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

select {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    color: var(--text-light);
    font-family: 'Vazir', Tahoma, sans-serif;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.info-box {
    background-color: rgba(13, 128, 68, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.sun-time {
    display: block;
    margin: 18px auto 0 auto;
    font-size: 2.2rem;
    color: #d4af37;
    font-family: 'Vazirmatn', 'Vazir', Tahoma, Arial, sans-serif;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
    direction: ltr;
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.18);
}

.info-box h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.tables-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.table-wrapper {
    background-color: rgba(13, 128, 68, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--border-radius);
    padding: 20px;
    overflow-x: auto;
}

.table-wrapper h3 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px; /* Set font size as requested */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 12px;
    text-align: center;
}

thead th {
    background-color: rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
    font-weight: bold;
}

tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.15);
}

tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.15);
}

tbody tr.active-row {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1));
    color: var(--gold-light);
    font-weight: bold;
}

/* Pulsing circles warning state */
.timer-box.warning {
    color: #ff6b6b;
    font-weight: bold;
    position: relative;
    padding: 0 18px; /* Space for circles on both sides */
}

.timer-box.warning::before,
.timer-box.warning::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ff4d4d;
    border-radius: 50%;
    opacity: 0;
}

.timer-box.warning::before {
    animation: pulseCircle 2s infinite;
    left: 0;
}

.timer-box.warning::after {
    animation: pulseCircle 2s 0.3s infinite;
    right: 0;
}

@keyframes pulseCircle {
    0% {
        transform: translateY(-50%) scale(0.8);
        opacity: 0;
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) scale(1.2);
        opacity: 0;
        box-shadow: 0 0 0 8px rgba(255, 77, 77, 0);
    }
}

/* Responsive (simple) */
@media (max-width: 768px) {
    .tables-container, .select-container, .info-boxes-container, .time-boxes-container {
        flex-direction: column;
    }
    body {
        padding: 10px;
    }
}

.calculation-details {
    margin-top: 20px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    text-align: center; /* Added for centering text as per visual design */
}

.calculation-details p {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 1.1rem; /* Adjusted for better readability */
}

.calculation-details strong {
    color: var(--secondary-color);
    font-weight: bold;
}

/* Horizontal Mini Boxes for Calculation Results */
.horizontal-mini-boxes {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.horizontal-mini-boxes .info-box {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.calculation-label {
    font-size: 0.9rem;
    color: var(--gold-light);
    margin-bottom: 8px;
}

.calculation-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-light);
}

/* Ruling Planets Section */
.ruling-planets-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.ruling-planet-of-the-day-box,
.current-ruling-planet-box {
    flex: 1;
    padding: 25px;
    background: rgba(13, 128, 68, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.ruling-planet-of-the-day-box:hover,
.current-ruling-planet-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
}

.ruling-planet-of-the-day-box h3,
.current-ruling-planet-box h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: bold;
}

#ruling-planet-of-the-day {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--gold-light);
}

/* Current Ruling Planet Content */
.current-ruling-planet-content .current-planet-name {
    font-size: 1.9rem; 
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
    display: block; 
    text-align: center;
}

.current-ruling-planet-content .current-planet-details {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: center;
}

.current-ruling-planet-content .current-planet-time,
.current-ruling-planet-content .current-planet-duration {
    margin-bottom: 8px;
}

.current-ruling-planet-content #current-ruling-planet-duration {
    font-weight: 500;
    color: var(--gold-light);
    display: inline-block; 
}

/* Ruling Planet of the Day Box Title */
.ruling-planet-box h3 {
    font-size: 24px;
    color: #d4af37 !important;
    font-weight: bold; /* Changed from 600 to bold */
    margin-bottom: 15px;
}

/* Ruling Planet of the Day Box Content */
.ruling-planet-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px; /* فاصله بین آیکون و نام کوکب */
}

.ruling-planet-content .planet-name-container, #ruling-planet-name {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: -1px;
    direction: rtl;
    color: #d4af37 !important;
}

/* Current Ruling Planet Box Content */
.current-ruling-planet-content {
    display: flex;
    flex-direction: column; /* چیدمان عمودی برای محتوای داخلی */
    align-items: center;
    gap: 20px;
}

.day-table {
  position: relative;
  background: inherit; /* رنگ فعلی جدول روز حفظ شود */
  color: inherit;
  border-radius: 18px;
  border: 1.5px solid rgba(220,200,120,0.13);
  box-shadow: 0 6px 28px 0 rgba(220,200,120,0.13), 0 1.5px 0 0 #fff2 inset;
  backdrop-filter: blur(6px) saturate(1.08);
  overflow: hidden;
  font-size: 1.11em;
  font-family: inherit;
  transition: box-shadow 0.2s, border 0.2s;
}
.day-table th, .day-table td {
  border-color: rgba(220,200,120,0.13);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.2s;
}
.day-table tr:hover td {
  background: rgba(255, 255, 255, 0.07);
}
.day-table thead {
  background: rgba(255,255,255,0.13);
  box-shadow: 0 0 10px 0 #fff2;
  border-bottom: 2px solid #f7e9b2;
}
.day-table th {
  text-shadow: 0 1px 8px #fff7, 0 0 1px #fff3;
  font-size: 1.07em;
  border-bottom: 2px solid #f7e9b2;
}
.day-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.04);
}
.day-table tbody tr:nth-child(odd) td {
  background: rgba(255,255,255,0.01);
}

.night-table {
  position: relative;
  background: linear-gradient(135deg, #182544 0%, #22335a 60%, #23406e 100%);
  color: #fff;
  border-radius: 18px;
  border: 1.5px solid rgba(80,100,200,0.23);
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.38), 0 1.5px 0 0 #fff1 inset;
  backdrop-filter: blur(7px) saturate(1.25);
  overflow: hidden;
  font-size: 1.13em;
  font-family: inherit;
}
.night-table::before {
  content: url("../images/moon-icon.svg");
  position: absolute;
  top: 7px;
  right: 16px;
  width: 28px;
  height: 28px;
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
}
.night-table th, .night-table td {
  border-color: rgba(180,200,255,0.15);
  color: #fff;
  background: rgba(24,28,42,0.12);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.2s;
}
.night-table tr:hover td {
  background: rgba(60,80,120,0.23);
}
.night-table thead {
  background: linear-gradient(90deg, #2a315a 60%, #3a2c53 100%);
  box-shadow: 0 0 16px 0 #000a;
  border-bottom: 2.5px solid #5e5f9e;
}
.night-table th {
  text-shadow: 0 1px 10px #000, 0 0 1px #fff3;
  font-size: 1.09em;
  border-bottom: 2.5px solid #5e5f9e;
}
.night-table tbody tr:nth-child(even) td {
  background: rgba(44,48,68,0.28);
}
.night-table tbody tr:nth-child(odd) td {
  background: rgba(28,32,54,0.22);
}

.night-table th, .night-table td {
  border-color: #26304a;
  color: #fff;
}
.night-table thead {
  background: #222842;
}

.property-nahes {
  color: #FF3030 !important;
  font-weight: bold;
  text-shadow: 0 0 7px #000, 0 0 2px #000;
}
.property-saad {
  color: #38D164 !important;
  font-weight: bold;
  text-shadow: 0 0 7px #000, 0 0 2px #000;
}
.property-neutral {
  color: #fff !important;
  font-weight: bold;
  text-shadow: 0 0 7px #000, 0 0 2px #000;
}

.current-planet-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.planet-name-and-status {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.day-night-indicator {
    font-size: 0.9rem;
    color: var(--gold-light);
    opacity: 0.8;
}

.current-planet-details {
    width: 100%;
}

.time-info-modern, .duration-info-modern, .next-planet-info-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    padding-bottom: 8px;
}

.time-info-modern:last-child, .duration-info-modern:last-child, .next-planet-info-modern:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.time-label, .duration-label, .next-planet-label {
    color: var(--text-light);
    opacity: 0.9;
}

.time-value-fancy, .duration-value-fancy, .next-planet-name-fancy {
    color: var(--gold-light);
    font-weight: 500;
    letter-spacing: 1px;
}

.current-ruling-planet-box-resized {
    max-width: 280px; /* این مقدار برای کنترل عرض باکس حاکم فعلی است */
    flex-shrink: 0; /* جلوگیری از کوچک شدن باکس */
}

.ruling-planet-box-expanded {
    flex-grow: 1;
    flex-basis: 0; /* جلوگیری از تغییر عرض بر اساس محتوا */
    min-width: 0; /* اجازه به باکس برای کوچک شدن در صورت نیاز */
}

.planet-description {
    font-size: 0.95rem;
    color: var(--text-light);
    opacity: 0.9;
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    line-height: 1.7;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    max-height: 200px; /* برای جلوگیری از ارتفاع بیش از حد */
    overflow-y: auto; /* فعال کردن اسکرول در صورت نیاز */
    direction: rtl;
}
