:root{
  --gold:#d4af37;
  --dark:#0b2a1f;
  --green:#0f5132;
  --soft:#f4f8f6;
  --light-gold:rgba(212, 175, 55, 0.15);
}

* {
  box-sizing: border-box;
  transition: all 0.3s ease;
}

body{
  margin:0;
  font-family:'Poppins',sans-serif;
  background:linear-gradient(180deg,#071f17,#0b2a1f 40%,#071f17);
  color:#fff;
  min-height:100vh;
  overflow-x: hidden;
}

/* Animasi latar belakang bergerak */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
  background: 
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(15, 81, 50, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(11, 42, 31, 0.1) 0%, transparent 50%);
  animation: floatBackground 20s ease-in-out infinite alternate;
}

@keyframes floatBackground {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, -20px) scale(1.05); }
  100% { transform: translate(20px, 20px) scale(1); }
}

header{
  background:radial-gradient(circle at top, #123c2b, #071f17);
  border-bottom:2px solid var(--gold);
  padding:30px 20px;
  text-align:center;
  position: relative;
  overflow: hidden;
}

/* Efek cahaya di header */
.header-glow {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2), transparent 70%);
  animation: rotateGlow 15s linear infinite;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg) translate(0) scale(1); }
  100% { transform: rotate(360deg) translate(50px) scale(1.2); }
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* LOGO FIXED - TIDAK GEPENG */
.logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

header img{
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: #fff;
  padding: 5px;
  position: relative;
  z-index: 2;
  animation: floatLogo 6s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
  display: block;
}

/* Efek lingkaran emas di belakang logo */
.logo-container::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2), transparent 70%);
  animation: pulseRing 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(2deg); }
  66% { transform: translateY(5px) rotate(-1deg); }
}

header h1{
  margin:15px 0 5px;
  font-family:'Amiri',serif;
  font-size:2.2rem;
  color:var(--gold);
  letter-spacing:1px;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

header p{
  margin:0;
  opacity:.9;
  position: relative;
  z-index: 2;
}

.container{
  max-width:1100px;
  margin:30px auto 60px;
  padding:0 16px;
  position: relative;
  z-index: 1;
}

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  justify-content:center;
  margin-bottom:24px;
  align-items: center;
  padding: 20px;
  background: rgba(15, 59, 44, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.clock-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.clock-box {
  background: rgba(11, 42, 31, 0.8);
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-family: 'Courier New', monospace;
  font-weight: 600;
  min-width: 140px;
  text-align: center;
  animation: pulse 2s infinite;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 5px 25px rgba(212, 175, 55, 0.3); }
}

.select-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 15px;
}

select{
  background:#0f3b2c;
  color:#fff;
  border:1px solid var(--gold);
  padding:10px 14px;
  border-radius:8px;
  font-size:1rem;
  outline:none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
}

select:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
  background: #0f5132;
}

select:focus {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.5);
}

table{
  width:100%;
  border-collapse:collapse;
  background:linear-gradient(180deg,#0f3b2c,#0b2a1f);
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 15px 40px rgba(0,0,0,.45);
  animation: fadeInUp 1s ease-out 0.2s both;
  position: relative;
}

table::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: tableShimmer 4s infinite;
}

@keyframes tableShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

thead{
  background:linear-gradient(90deg,#1a6b4f,#0f5132);
  position: relative;
}

thead::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent, var(--gold));
}

thead th{
  padding:14px 10px;
  font-weight:600;
  color:var(--gold);
  border-bottom:2px solid var(--gold);
  text-align:center;
  font-size:.95rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

thead th:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

tbody td{
  padding:12px 8px;
  text-align:center;
  border-bottom:1px solid rgba(212,175,55,.25);
  font-size:.9rem;
  transition: all 0.3s ease;
  position: relative;
}

tbody td:hover {
  transform: scale(1.05);
  z-index: 1;
  background: rgba(212, 175, 55, 0.1) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

tbody tr:nth-child(even){
  background:rgba(255,255,255,.03);
}

tbody tr:hover{
  background:rgba(212,175,55,.08);
}

.today{
  background:rgba(212,175,55,.18) !important;
  font-weight:600;
  position: relative;
  animation: highlightPulse 3s infinite;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0.5); }
  50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.7); }
}

.today::before {
  content: '⸻';
  position: absolute;
  left: 5px;
  color: var(--gold);
  animation: todayIndicator 2s infinite;
}

@keyframes todayIndicator {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.prayer-time {
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.prayer-time:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

footer{
  text-align:center;
  padding:20px;
  font-size:.85rem;
  opacity:.8;
  position: relative;
  background: rgba(11, 42, 31, 0.8);
  margin-top: 40px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Efek partikel */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  background: rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  to {
    transform: translateY(-100vh) rotate(360deg);
  }
}

/* Loader animasi */
.loader {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  border-top-color: var(--gold);
  animation: spin 1s ease-in-out infinite;
}

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

/* Animasi untuk data baru masuk */
@keyframes fadeInRow {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

tbody tr {
  animation: fadeInRow 0.5s ease-out forwards;
  opacity: 0;
}

tbody tr:nth-child(1) { animation-delay: 0.1s; }
tbody tr:nth-child(2) { animation-delay: 0.2s; }
tbody tr:nth-child(3) { animation-delay: 0.3s; }
tbody tr:nth-child(4) { animation-delay: 0.4s; }
tbody tr:nth-child(5) { animation-delay: 0.5s; }
tbody tr:nth-child(6) { animation-delay: 0.6s; }
tbody tr:nth-child(7) { animation-delay: 0.7s; }
tbody tr:nth-child(8) { animation-delay: 0.8s; }
tbody tr:nth-child(9) { animation-delay: 0.9s; }
tbody tr:nth-child(10) { animation-delay: 1s; }

@media(max-width:768px){
  header h1{font-size:1.8rem}
  thead th,tbody td{font-size:.8rem;padding:10px 6px}
  .clock-box {
    min-width: 120px;
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  header img {
    width: 100px;
    height: 100px;
  }
}

@media(max-width:480px){
  header img {
    width: 90px;
    height: 90px;
  }
  .clock-box {
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  select {
    min-width: 130px;
    padding: 8px 12px;
  }
}