/* css/style.css */

:root {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --accent-color: #ff9800; /* Spiritual Orange/Saffron */
    --card-bg: #2d2d2d;
    --success-color: #4caf50;
    --font-main: 'Mukta', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none; /* Prevent selection text on taps */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Prevent scroll on fullscreen counter */
    height: 100vh;
    width: 100vw;
}

.app-container {
    height: 100%;
    width: 100%;
    position: relative;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-color);
    z-index: 1;
    overflow-y: auto;
}

.view.active {
    display: flex;
    z-index: 10;
}

/* Authentication Styles */
.auth-box {
    margin: auto;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h1 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 15px;
}

.auth-form.active {
    display: flex;
}

input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #333;
    color: white;
    font-size: 1rem;
}

button.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

button.btn-secondary {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    width: 100%;
    cursor: pointer;
}

.divider {
    margin: 20px 0;
    color: #666;
    font-size: 0.8rem;
}

/* Dashboard Styles */
.top-bar {
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.btn-text {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
}

.jap-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    border: 1px solid #333;
    transition: transform 0.1s;
}

.jap-card:active {
    transform: scale(0.98);
}

.jap-card h3 {
    color: var(--accent-color);
}

/* Leaderboard Styles */
.leaderboard-preview {
    margin-top: 20px;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#leaderboard-list {
    background: #252525;
    border-radius: 8px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.lb-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
}

.lb-row.my-rank {
    color: var(--accent-color);
    font-weight: bold;
}

/* Counter Styles */
#counter-view {
    padding: 0;
    overflow: hidden;
}

.counter-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 100%);
    cursor: pointer;
}

.top-info {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20; /* Ensure controls are clickable */
}

/* Prevent tap propagation on controls */
.top-info > * {
    pointer-events: auto; 
}

.center-count {
    text-align: center;
    pointer-events: none; /* Passes click through to overlay */
}

#jap-count-display {
    font-size: 6rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 152, 0, 0.3);
}

#mala-count-display {
    font-size: 1.5rem;
    color: #888;
    margin-top: 10px;
}

.bottom-feedback {
    padding: 40px;
    color: #666;
    pointer-events: none;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-anim {
    animation: pulse 0.2s ease-out;
}
