﻿/* Import Poppins font for modern look */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* CSS Variables for College Theme Colors */
:root {
  --primary-color: #00529c;
  --secondary-color: #128db8;
  --accent-color: #f36f21;
  --text-color: #0c0404;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --border-color: #e9ecef;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --surface-color: #ffffff;
  --muted-color: #64748b;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Custom Text Selection Colors */
::selection {
  background: var(--accent-color);
  color: var(--white);
  text-shadow: none;
}

::-moz-selection {
  background: var(--accent-color);
  color: var(--white);
  text-shadow: none;
}

/* Enhanced selection for specific elements */
.college-name::selection {
  background: var(--secondary-color);
  color: var(--white);
}

.college-name::-moz-selection {
  background: var(--secondary-color);
  color: var(--white);
}

.spinner-title::selection,
.winner-number::selection {
  background: var(--primary-color);
  color: var(--white);
}

.spinner-title::-moz-selection,
.winner-number::-moz-selection {
  background: var(--primary-color);
  color: var(--white);
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-color);
}

/* College Header */
.college-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  padding: 15px 0;
  box-shadow: 0 8px 32px rgba(0, 82, 156, 0.3);
  position: relative;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.college-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 70%
  );
  animation: headerShimmer 4s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.header-content {
  max-width: 1450px;
  margin: 0 auto;
  align-items: center;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

.college-logo-section {
  display: flex;
  align-items: center;
  gap: 30px;
  background: rgba(255, 255, 255, 0.1);
  padding: 25px 35px;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 82, 156, 0.2);
}

.logo-container {
  width: 300px;
  height: 140px;
  background: var(--white);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 82, 156, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.9);
  border: 4px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-image {
  width: 100%;
  height: 100%;
  mix-blend-mode: darken;
  object-fit: contain;
  border-radius: 12px;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.logo-container:hover .logo-image {
  transform: scale(1.05);
}

.college-info {
  color: var(--white);
  text-align: left;
}

.college-name {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  background: linear-gradient(45deg, var(--white), rgba(255, 255, 255, 0.95));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  line-height: 1.1;
}

.college-name::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 180px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
  border-radius: 2px;
}

.college-tagline {
  font-size: 3.2rem;
  opacity: 0.95;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
  margin-top: 10px;
}

/* Main Container Dashboard */
.main-container {
  max-width: 1450px;
  margin: 30px auto;
  padding: 0 20px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* Main Control & Game Trigger Dashboard Section */
.spinner-section {
  flex: 1;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.dashboard-status-card {
  background: #f8fafc;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Sidebar History Panel Layout */
.control-panel {
  flex: 0 0 450px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 255, 0.98) 100%);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  position: sticky;
  top: 30px;
  height: fit-content;
}

/* Called Numbers History Scroll Area */
#calledHistory::-webkit-scrollbar {
  width: 8px;
}
#calledHistory::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
#calledHistory::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
#calledHistory::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Primary Game Draw Button Configuration */
.spin-button {
  background: linear-gradient(135deg, #f36f21 0%, #e05300 100%);
  color: var(--white);
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(243, 111, 33, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.spin-button:hover {
  transform: scale(1.04);
  box-shadow: 0 15px 40px rgba(243, 111, 33, 0.6);
}

.spin-button:active {
  transform: scale(0.98);
}

.spin-button:disabled {
  background: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Modals Overlay Configurations Base */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

/* Fullscreen Immersive Overlay Specific layout centering */
#wheelOverlay {
  transition: all 0.4s ease;
}

.big-wheel-box {
  background: #ffffff;
  transform-origin: center center;
  transition: box-shadow 0.3s ease;
}

/* Standard Modal Content Windows (Winner Announcement Popup) */
.modal-content {
  background: #ffffff;
  margin: 4% auto;
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

@keyframes modalSlideIn {
  from { transform: translateY(-60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  padding: 25px;
  text-align: center;
  position: relative;
}

.trophy-icon {
  font-size: 3rem;
  color: #ffd700;
  margin-bottom: 5px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
  animation: trophyBounce 1s ease infinite alternate;
}

@keyframes trophyBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.modal-header h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 40px 30px;
  display: flex;
  justify-content: center;
  background: #f8fafc;
}

.winner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

.winner-number-display {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: 24px;
  border: 4px solid var(--primary-color);
  box-shadow: 0 15px 35px rgba(0, 82, 156, 0.2), inset 0 4px 10px rgba(255,255,255,0.8);
}

.winner-number {
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.modal-footer {
  padding: 20px 30px;
  background: #f1f5f9;
  display: flex;
  gap: 15px;
  justify-content: center;
  border-top: 1px solid #e2e8f0;
}

.new-draw-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.new-draw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
}

.close-btn {
  padding: 14px 24px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

/* Confetti Structures Base Layer */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1100;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  animation: fallAndFade 3s ease-out forwards;
  opacity: 0;
}

@keyframes fallAndFade {
  0% { opacity: 0; transform: translateY(-50px) scale(0.5) rotate(0deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(105vh) scale(0.3) rotate(450deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN CONTROL SYSTEM (Prevents Layout Shifts & Shrink Crashing)
   ========================================================================== */
@media (max-width: 1200px) {
  .main-container {
    flex-direction: column;
    gap: 30px;
    align-items: center;
  }

  .control-panel {
    flex: auto;
    width: 100%;
    position: relative;
    top: auto;
    order: 2;
  }

  .spinner-section {
    order: 1;
    width: 100%;
  }
}
@media (max-width: 1100px) {
    .dual-wheel-frame {
        padding: 50px 30px 30px 30px !important;
        gap: 30px !important;
    }

    .big-wheel-box.wheel-container-item {
        width: 360px !important;
        height: 360px !important;
    }

    #wheel1, #wheel2 {
        width: 360px !important;
        height: 360px !important;
    }
}
@media (max-width: 1024px) {
    .big-wheel-box.wheel-container-item {
        width: 340px !important;
        height: 340px !important;
    }

    #wheel1, #wheel2 {
        width: 340px !important;
        height: 340px !important;
    }
}
@media (max-width: 820px) {
    .dual-wheel-frame {
        padding: 40px 20px 20px 20px !important;
        gap: 25px !important;
    }

    .big-wheel-box.wheel-container-item {
        width: 280px !important;
        height: 280px !important;
    }

    #wheel1, #wheel2 {
        width: 280px !important;
        height: 280px !important;
    }
}

@media (max-width: 768px) {
  .header-content {
    padding: 0 20px;
  }
    .dual-wheel-frame {
        flex-direction: column !important;
        padding: 40px 20px 20px 20px !important;
        gap: 35px !important;
        max-height: 95vh !important;
        overflow-y: auto !important;
    }

    .big-wheel-box.wheel-container-item {
        width: 270px !important;
        height: 270px !important;
    }

    #wheel1, #wheel2 {
        width: 270px !important;
        height: 270px !important;
    }
  .college-logo-section {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 15px;
  }

  .logo-container {
    width: 260px;
    height: 120px;
  }

  .college-name { font-size: 2.3rem; }
  .college-tagline { font-size: 1.4rem; }

  /* Smooth Scale Decrements to retain wheel circular geometry layout ratios */
  .big-wheel-box {
    width: 480px !important;
    height: 480px !important;
  }

  #mainWheel {
    width: 480px !important;
    height: 480px !important;
  }

  .spinner-wrapper {
    transform: scale(1.0) !important;
  }
}

@media (max-width: 480px) {
  .logo-container {
    width: 200px;
    height: 100px;
    padding: 10px;
  }
    .big-wheel-box.wheel-container-item {
        width: 220px !important;
        height: 220px !important;
    }

    #wheel1, #wheel2 {
        width: 220px !important;
        height: 220px !important;
    }

  .college-name { font-size: 1.8rem; }
  .college-tagline { font-size: 1.1rem; }

  .spin-button {
    font-size: 1.3rem !important;
    padding: 20px 40px !important;
  }

  /* Safe handling parameters inside compressed smartphone screens */
  .big-wheel-box {
    width: 310px !important;
    height: 310px !important;
  }

  #mainWheel {
    width: 310px !important;
    height: 310px !important;
  }

  .pointer {
    border-left: 20px solid transparent !important;
    border-right: 20px solid transparent !important;
    border-top: 35px solid #f36f21 !important;
    top: -18px !important;
  }

  .winner-number-display {
    width: 180px !important;
    height: 140px !important;
  }

  .winner-number {
    font-size: 4.5rem !important;
  }
}