/* --- Padel Alarms --- */
:root {
  --court-green: #1e7f3b;
  --court-lines: #e8f5e9;
  --accent: #ffd54f;
  --dark-bg: rgba(0,0,0,.5);
  --light-text: #ffffff;
  --dark-text: #111827;
  --secondary-bg: #555;
  --danger-bg: #c53030;
  --default-gradient: radial-gradient(circle at 50% 30%, #2aa658 0%, #1e7f3b 60%, #145b2a 100%);
}
html, body {
  height: 100%; margin: 0; font-family: system-ui, sans-serif;
  color: var(--light-text);
  background: var(--default-gradient);
  overflow-x: hidden;
  min-height: 150vh; /* Ensure page is tall enough to scroll */
  padding-bottom: 80px; /* Space for sticky footer */
}
.court { position: fixed; inset: 0; z-index: -1; }
.court::before, .court::after, .court-bottom::before, .court-bottom::after {
  content: ""; 
  position: absolute; 
  width: 100px;
  height: 100px;
  border: 6px solid var(--court-lines);
}
.court::before { top: 5%; left: 7%; border-right: none; border-bottom: none; border-radius: 24px 0 0 0; }
.court::after { top: 5%; right: 7%; border-left: none; border-bottom: none; border-radius: 0 24px 0 0; }
.court-bottom::before { bottom: 5%; left: 7%; border-right: none; border-top: none; border-radius: 0 0 0 24px; }
.court-bottom::after { bottom: 5%; right: 7%; border-left: none; border-top: none; border-radius: 0 0 24px 0; }

.wake-lock-status {
    position: fixed; top: 1em; right: 1em;
    width: 32px; height: 32px;
    z-index: 10; opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}
.wake-lock-status img {
    width: 100%; height: 100%;
    filter: invert(89%) sepia(38%) saturate(541%) hue-rotate(346deg) brightness(104%) contrast(96%);
}
.wake-lock-status.is-active { 
    opacity: 1; 
    animation: wakePulse 2s ease-in-out infinite;
}

@keyframes wakePulse {
    0%, 100% { transform: scale(1); filter: none; }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(255,213,79,0.6)); }
}

/* --- Test Alarm Notification --- */
.test-alarm-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: 3px solid #fca5a5;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.4);
    min-width: 320px;
    max-width: 500px;
    animation: testAlarmPulse 2s ease-in-out infinite;
    font-family: inherit;
}

.test-alarm-notification .notification-content {
    padding: 1.5em 2em;
    text-align: center;
}

.test-alarm-notification .notification-message {
    color: white;
    font-weight: 700;
    font-size: 1.3em;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes testAlarmPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 12px 40px rgba(220, 38, 38, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 16px 50px rgba(220, 38, 38, 0.6);
    }
}

.wrap {
  position: relative; z-index: 2; min-height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: center;
  text-align: center; padding: 0.8em;
  max-width: 1920px; margin: 0 auto;
}
.page-header { display: flex; flex-direction: column; align-items: center; gap: 1.5em; width: 100%; }
.alarmSelector {
  position: relative; z-index: 3; 
  background: var(--dark-bg); padding: .5em 1em; 
  border-radius: 12px; display: flex;
  flex-direction: column; align-items: center;
  gap: .5em; width: 90%; max-width: 600px;
  box-sizing: border-box;
}
.alarmSelector select { 
  width: 100%; 
  padding: 0.8em 1em;
  font-size: 1.1em;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3);
  color: var(--light-text);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.alarmSelector select:focus {
  outline: none;
  border-color: var(--accent);
}
.logo-container { height: 250px; display: flex; align-items: center; justify-content: center; }
.group-logo {
    max-height: 100%; max-width: 90vw;
    border-radius: 16px; background: rgba(255,255,255,0.1);
    padding: 15px; box-sizing: border-box;
    opacity: 0; transform: scale(0.95);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.group-logo.is-visible { opacity: 1; transform: scale(1); }
h1 { font-size: clamp(28px, 6vmin, 60px); margin: 0; }
.group-notes-display {
    font-style: italic; max-width: 60ch; margin: -0.5em 0 0 0;
    min-height: 1.2em; opacity: 0;
    transition: opacity 0.4s ease-out;
    font-size: clamp(16px, 3vmin, 24px);
    color: var(--light-text);
    text-align: center;
    line-height: 1.4;
}
.group-notes-display.is-visible { opacity: 0.9; }
.group-notes-display#advanceNotice {
    font-size: clamp(12px, 1.8vmin, 18px);
    margin: -1.8em 0 0 0; /* tiny gap under the title */
    padding: 0;
    line-height: 1.2;
    opacity: 0.85;
}
.clock-container { margin: 2vmin 0; }

.main-countdown-wrapper {
    background: rgba(0,0,0,.25);
    border: 2px solid rgba(255,255,255,.25);
    padding: 0.5em 2em;
    border-radius: 30px;
    transition: box-shadow 0.5s ease-out;
}
.main-countdown-title {
    margin: 0;
    font-size: clamp(22px, 4vmin, 36px);
    font-weight: 500;
    opacity: 0.8;
}
.now {
    font-size: clamp(60px, 18vmin, 200px);
    font-weight: 900;
    line-height: 1.1;
}
@keyframes glow-urgent {
    0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 0 0 10px rgba(255, 213, 79, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 213, 79, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 0 0 10px rgba(255, 213, 79, 0.3); }
}
.main-countdown-wrapper.is-glowing {
    animation: glow-urgent 1.5s infinite;
}

.sub { display: flex; gap: 3vmin; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 1em; }
.chip {
  background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.25);
  padding: 1em 1.4em; border-radius: 999px;
  font-size: clamp(20px, 4vmin, 32px);
}
.page-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
button, .admin-button, .admin-link-button {
  margin: .5em; padding: 1em 1.6em; border-radius: 999px;
  border: none; cursor: pointer; background: var(--accent);
  color: var(--dark-text); font-weight: 700; font-size: clamp(16px, 2.5vmin, 24px);
  transition: transform 0.1s ease-out, background-color 0.2s;
  text-decoration: none; display: inline-block;
}
button:hover, .admin-button:hover, .admin-link-button:hover { transform: scale(1.05); }
.secondary-button { background: var(--secondary-bg); color: var(--light-text); }

@keyframes flashBg { 50% { background: var(--accent); } }
body.flash { animation: flashBg 1s steps(2, end) infinite; background: var(--default-gradient); }

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9em;
    opacity: 0.6;
    padding: 1em;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
    z-index: 1000;
}
.site-footer a { color: var(--light-text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .version-info { font-size: 0.8em; }
.feedback-link { 
    color: var(--light-text); 
    text-decoration: none; 
    font-size: 0.9em; 
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.feedback-link:hover { 
    text-decoration: underline; 
    opacity: 1;
}
.admin-panel { align-content: flex-start; }
.admin-header { margin-bottom: 1em; }
.admin-header h1 { margin-bottom: 0.25em; }
.admin-header p { margin: 0; font-size: 1.1em; opacity: 0.9; }
.admin-header-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.error-container { width: 100%; max-width: 1200px; box-sizing: border-box; padding: 0 1em 1em 1em; }
.error-message { background-color: var(--danger-bg); color: var(--light-text); padding: 1em; border-radius: 8px; }
.group-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5em; width: 100%; max-width: 1200px; padding: 0 1em; box-sizing: border-box; min-height: auto; align-content: start; }

/* Main element specific styling */
main.group-container {
    min-height: auto;
    height: auto;
    flex: none;
}

/* Ensure body and html don't create extra space */
body, html {
    height: auto;
    min-height: auto;
}

/* Compact layout when filtered */
.group-container:has(.no-results) {
    min-height: auto;
    height: auto;
}
@media (max-width: 599px) { .group-container { grid-template-columns: 1fr; } }
.group-card { background: var(--dark-bg); border-radius: 16px; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 4px 20px rgba(0,0,0,0.3); display: flex; flex-direction: column; text-align: left; overflow: hidden; }
.card-header { padding: 1.25em; }
.card-header h2 { margin: 0 0 0.5em 0; font-size: 1.5em; word-break: break-word; }
.card-notes { margin: 0; font-size: 0.9em; opacity: 0.8; font-style: italic; white-space: pre-wrap; }
.card-body { padding: 0 1.25em 1.25em; margin-top: auto; }
.card-url input { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); color: var(--light-text); padding: 0.5em; border-radius: 4px; font-size: 0.8em; cursor: copy; margin-bottom: 1em; }
.card-footer { display: flex; justify-content: flex-end; gap: 0.5em; }
.admin-button.small { padding: .5em 1em; font-size: 14px; margin: 0; }
.admin-button.secondary { background: var(--secondary-bg); color: var(--light-text); }
.admin-button.danger { background: var(--danger-bg); color: var(--light-text); }
.group-card.is-creator { background: transparent; border-style: dashed; cursor: pointer; transition: background-color 0.2s, border-color 0.2s; display: flex; align-items: center; justify-content: center; }
.group-card.is-creator:hover { background-color: rgba(255,255,255,0.1); border-color: var(--accent); }
.is-creator .card-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em; font-size: 1.5em; font-weight: 500; width: 100%; height: 100%; min-height: 150px; text-align: center; }
.plus-icon { font-size: 3em; line-height: 1; color: var(--accent); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; display: none; align-items: center; justify-content: center; padding: 1em; backdrop-filter: blur(5px); }
.modal.is-visible { display: flex; }
.modal-content { background: #1e293b; border: 1px solid rgba(255,255,255,0.2); border-radius: 16px; width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; animation: fadeIn 0.3s ease-out; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1em 1.5em; border-bottom: 1px solid rgba(255,255,255,0.2); }
.modal-header h2 { margin: 0; }
.close-button { background: none; border: none; font-size: 2em; color: var(--light-text); cursor: pointer; line-height: 1; padding: 0; }
.modal-form { padding: 1.5em; overflow-y: auto; }
.form-field { margin-bottom: 1.25em; }
.form-field label { display: block; margin-bottom: .5em; font-weight: 500; }
.form-field label small { font-weight: 400; opacity: 0.8; font-style: italic; }
.form-field input[type="text"], .form-field textarea { width: 100%; background: #334155; border: 1px solid #475569; color: var(--light-text); padding: .8em; border-radius: 8px; font-size: 1em; box-sizing: border-box; }
.form-field input[type="text"]:focus, .form-field textarea:focus { outline: none; border-color: var(--accent); }
.form-field-group { display: grid; grid-template-columns: 1fr; gap: 0.75em; width: 100%; }
.file-info { display: block; margin-top: .5em; font-size: 0.8em; opacity: 0.7; word-break: break-all; }
.form-help-text { 
    font-size: 0.8em; 
    opacity: 0.7; 
    margin-top: .5em; 
    display: block; 
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

/* Special styling for lock status notes */
.form-help-text[style*="color: #fca5a5"] {
    background: rgba(252, 165, 165, 0.1);
    padding: 0.75em;
    border-radius: 6px;
    border-left: 3px solid #fca5a5;
    margin-top: 0.75em;
    font-size: 0.85em;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* Display Alarms Modal Styling */
#displayAlarmsModal .modal-content {
    max-width: 600px;
    width: 90%;
}

.alarm-details-container {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.alarm-group-info {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    padding: 1em;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.group-logo-display {
    flex-shrink: 0;
}

.group-logo-display-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(71, 85, 105, 0.5);
}

.group-details {
    flex: 1;
}

.group-details h3 {
    margin: 0 0 0.5em 0;
    color: var(--light-text);
    font-size: 1.2em;
    font-weight: 600;
}

.group-description {
    margin: 0 0 0.5em 0;
    color: #cbd5e1;
    font-size: 0.95em;
    line-height: 1.4;
}

.warmup-info {
    margin: 0;
    color: #fbbf24;
    font-size: 0.9em;
    font-weight: 500;
    background: rgba(251, 191, 36, 0.1);
    padding: 0.5em 0.75em;
    border-radius: 4px;
    border-left: 3px solid #fbbf24;
}

.alarm-times-section h4 {
    margin: 0 0 1em 0;
    color: var(--light-text);
    font-size: 1.1em;
    font-weight: 600;
}

.alarm-times-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.alarm-time-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75em 1em;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    border-left: 4px solid #22c55e;
    transition: background-color 0.2s ease;
}

.alarm-time-item:hover {
    background: rgba(34, 197, 94, 0.15);
}

.alarm-time-item:last-child {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

.alarm-time-item:last-child:hover {
    background: rgba(239, 68, 68, 0.15);
}

.alarm-time-number {
    font-weight: 600;
    color: #22c55e;
    font-size: 0.9em;
    min-width: 2em;
}

.alarm-time-item:last-child .alarm-time-number {
    color: #ef4444;
}

.alarm-time-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--light-text);
}

.alarm-time-label {
    font-size: 0.9em;
    color: #94a3b8;
    font-style: italic;
}

.loading-message {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 2em;
}

.no-alarms-message {
    text-align: center;
    color: #fca5a5;
    font-style: italic;
    padding: 2em;
    background: rgba(252, 165, 165, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(252, 165, 165, 0.2);
}

/* User Login Section Styling */
.user-login-section {
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.login-button-container {
    margin-top: 1em;
    display: flex;
    justify-content: flex-start;
}

.login-button-container .admin-button {
    min-width: 140px;
}

/* Superuser Login Styling */
.superuser-login-section {
    margin-top: 1.5em;
    padding-top: 1.5em;
}

.superuser-divider {
    text-align: center;
    margin: 1em 0;
    position: relative;
}

.superuser-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(71, 85, 105, 0.3);
}

.superuser-divider span {
    background: var(--dark-bg);
    padding: 0 1em;
    color: #94a3b8;
    font-size: 0.9em;
    position: relative;
    z-index: 1;
}

.superuser-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: 1px solid #b45309 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    min-width: 120px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
}

.superuser-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    border-color: #92400e !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.superuser-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* Improve button text wrapping in modal footer */
.modal-footer .admin-button {
    min-width: 100px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    padding: 0.75em 1em !important;
    font-size: 0.9em !important;
}

/* Specific styling for verify password button */
.modal-footer .admin-button:not(.superuser-btn):not(.secondary) {
    min-width: 110px !important;
}
.modal-footer { 
    padding: 1em 1.5em; 
    margin-top: 1em; 
    border-top: 1px solid rgba(255,255,255,0.2); 
    display: flex; 
    justify-content: flex-end; 
    gap: 0.75em; 
    flex-wrap: wrap;
    align-items: center;
}
.modal-footer .admin-button { 
    margin: 0; 
    flex-shrink: 0;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
/* Optimized for 1920x1080 screens */
@media (min-width: 1920px) {
    .wrap { padding: 0.5em; }
    .logo-container { height: 220px; }
    .page-header { gap: 1.2em; }
    .clock-container { margin: 1.5vmin 0; }
    .main-countdown-wrapper { padding: 0.4em 1.8em; }
    .now { font-size: clamp(50px, 15vmin, 180px); }
    .chip { font-size: clamp(18px, 3.5vmin, 28px); }
    .alarmSelector { max-width: 500px; }
}

/* Optimized for 1080p to 1920p screens */
@media (min-width: 1080px) and (max-width: 1919px) {
    .wrap { padding: 0.6em; }
    .logo-container { height: 240px; }
    .page-header { gap: 1.3em; }
    .clock-container { margin: 1.8vmin 0; }
    .main-countdown-wrapper { padding: 0.45em 1.9em; }
    .now { font-size: clamp(55px, 16vmin, 190px); }
    .chip { font-size: clamp(19px, 3.8vmin, 30px); }
    .alarmSelector { max-width: 550px; }
}

@media (max-width: 768px) {
    .wrap { padding: 1em .5em; justify-content: flex-start; gap: 2em; }
    .admin-panel { padding: 7em 0 2em 0; }
    .sub { flex-direction: column; gap: 1.5vmin; align-items: center;}
    .logo-container { height: 200px; }
    .group-logo { max-width: 85vw; padding: 12px; }
    .page-header { gap: 1.5em; }
}

/* --- Added for v2.8 Sound Modal --- */
.header-top-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    width: 100%;
}
.sound-control {
    background: var(--dark-bg);
    padding: .5em;
    border-radius: 12px;
    cursor: pointer;
    height: 40px; /* Adjust to match dropdown height */
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.sound-control img {
    width: 24px;
    height: 24px;
    filter: invert(1);
}
.modal-body {
    padding: 1.5em;
    text-align: center;
}
.modal-footer.justify-center {
    justify-content: center;
}

/* View modal specific styles for better scrolling */
.modal.is-visible .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.is-visible .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5em;
    max-height: calc(90vh - 120px); /* Account for header and footer */
}

.modal.is-visible .modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal.is-visible .modal-body::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.modal.is-visible .modal-body::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.modal.is-visible .modal-body::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* --- Lock Functionality Styles --- */
.lock-status-display {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-top: 0.5em;
}

.lock-status-text {
    font-weight: 500;
    padding: 0.5em 1em;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.lock-status-text.locked {
    background: rgba(197, 48, 48, 0.2);
    border-color: rgba(197, 48, 48, 0.4);
    color: #fca5a5;
}

.lock-status-text.unlocked {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.group-card.locked {
    border-color: rgba(197, 48, 48, 0.4);
    position: relative;
}

.group-card.locked::before {
    content: "🔒";
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    font-size: 1.2em;
    z-index: 1;
}

.group-card.locked .card-footer button[data-action="edit"] {
    opacity: 0.7;
    cursor: pointer;
    pointer-events: auto;
}

.group-card.locked .card-footer button[data-action="copy"] {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

.card-lock-status {
    margin: 0.5em 0 0 0;
    font-size: 0.8em;
    color: #fca5a5;
    font-style: italic;
    opacity: 0.9;
}

/* --- Lock Password Modal Enhanced Styling --- */
#lockPasswordModal .modal-content {
    max-width: 450px;
}

#lockPasswordModal .modal-body {
    text-align: left;
    padding: 1.5em;
}

#lockPasswordModal .form-field {
    margin-bottom: 1.5em;
}

#lockPasswordModal .form-field label {
    display: block;
    margin-bottom: 0.75em;
    font-weight: 600;
    color: var(--light-text);
    font-size: 1.1em;
}

#lockPasswordInput,
#superuserPasswordInput {
    width: 100%;
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border: 2px solid #64748b;
    color: var(--light-text);
    padding: 1em 1.2em;
    border-radius: 12px;
    font-size: 1.1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

#lockPasswordInput:focus,
#superuserPasswordInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.2);
    transform: translateY(-1px);
}

#lockPasswordInput::placeholder,
#superuserPasswordInput::placeholder {
    color: #94a3b8;
    opacity: 0.8;
}

#lockPasswordModal .modal-footer {
    justify-content: center;
    gap: 1em;
    padding: 1.5em;
}

#lockPasswordModal .modal-footer .admin-button {
    min-width: 120px;
    padding: 0.8em 1.5em;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#lockPasswordModal .modal-footer .admin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#lockPasswordModal .modal-footer .admin-button.secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: 1px solid #94a3b8;
}

#lockPasswordModal .modal-footer .admin-button.secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: #cbd5e1;
}

#lockPasswordModal .modal-footer .admin-button:not(.secondary) {
    background: linear-gradient(135deg, var(--court-green) 0%, #145b2a 100%);
    border: 1px solid #22c55e;
}

#lockPasswordModal .modal-footer .admin-button:not(.secondary):hover {
    background: linear-gradient(135deg, #22c55e 0%, var(--court-green) 100%);
    border-color: #4ade80;
}

/* --- Custom Notification Styles --- */
.custom-notification {
    position: fixed;
    z-index: 10000;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: 2px solid #4ade80;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 400px;
    animation: notificationSlideIn 0.3s ease-out;
    font-family: inherit;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1em 1.2em;
    gap: 1em;
}

.notification-message {
    color: white;
    font-weight: 600;
    font-size: 1em;
    line-height: 1.4;
    flex: 1;
}

.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.notification-close:active {
    transform: scale(0.95);
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Password Input Container and Toggle --- */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input[type="password"],
.password-input-container input[type="text"] {
    flex: 1;
    padding-right: 50px; /* Make room for the toggle button */
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    margin: auto 0; /* vertically center within container */
    transform: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #cbd5e1;
    /* Override global button:hover scale */
    transform: none;
}

.password-toggle:active { transform: none; }

/* Ensure global button hover scale does not affect password toggle */
button.password-toggle:hover,
button.password-toggle:focus {
    transform: none;
}

.password-toggle.showing {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.eye-icon { width: 20px; height: 20px; display: block; }

/* Session Status Banner */
.session-status-banner {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid #047857;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    font-size: 0.8rem;
    max-width: 200px;
}

.session-status-banner .session-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.session-status-banner .session-status {
    font-weight: 600;
    font-size: 0.8rem;
}

.session-status-banner .session-time {
    font-weight: 500;
    opacity: 0.9;
    font-size: 0.75rem;
}

.session-status-banner .session-actions {
    display: flex;
    gap: 0.25rem;
}

.session-status-banner .continue-session {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.session-status-banner .continue-session:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.session-status-banner .logout-btn {
    background: rgba(239, 68, 68, 0.8) !important;
    border: 1px solid rgba(239, 68, 68, 1) !important;
    color: white !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem !important;
    border-radius: 4px !important;
}

.session-status-banner .logout-btn:hover {
    background: rgba(239, 68, 68, 1) !important;
    border-color: #dc2626 !important;
}

/* Layout Switcher */
.layout-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--secondary-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    font-size: 0.8rem;
}

/* When session banner is present, move layout switcher down */
body:has(.session-status-banner) .layout-switcher {
    top: 5rem;
}

/* Back to Admin Button */
.back-to-admin-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
}

.back-to-admin-btn .back-btn {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--light-text);
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.back-to-admin-btn .back-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--dark-text);
    transform: translateY(-1px);
}

.layout-label {
    font-weight: 500;
    color: var(--light-text);
    font-size: 0.75rem;
}

.layout-buttons {
    display: flex;
    gap: 0.25rem;
}

.layout-btn {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.layout-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--dark-text);
    transform: translateY(-1px);
}

.layout-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--dark-text);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.layout-btn svg {
    width: 12px;
    height: 12px;
}

/* Group Container Layouts */
.group-container.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    min-height: auto;
    align-content: start;
}

/* Search Filter */
.search-filter {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--dark-bg);
    color: var(--light-text);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    background: var(--secondary-bg);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--light-text);
    opacity: 0.6;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--accent);
    pointer-events: none;
}

.group-container.row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: auto;
    align-content: start;
}

.group-container.row .group-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 80px 200px;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: var(--dark-bg);
    transition: background-color 0.2s ease;
}

.group-container.row .group-card:hover {
    background: var(--secondary-bg);
}

.group-container.row .group-card.is-creator {
    grid-template-columns: 1fr;
    justify-content: center;
    text-align: center;
}

.group-container.row .group-card .card-content {
    display: contents;
}

.group-container.row .group-card .group-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light-text);
    margin: 0;
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
}

.group-container.row .group-card .group-notes {
    font-size: 0.9rem;
    color: var(--light-text);
    opacity: 0.7;
    margin: 0;
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
    word-wrap: break-word;
    white-space: normal;
}

.group-container.row .group-card .group-times {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
    margin: 0;
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
}

.group-container.row .group-card .group-status {
    font-size: 0.85rem;
    color: var(--light-text);
    margin: 0;
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
    text-align: center;
}

.group-container.row .group-card .group-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.25rem;
}

.group-container.row .group-card .group-actions .admin-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: auto;
}

/* Row Layout Header */
.row-header {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 80px 200px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--secondary-bg);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--light-text);
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.row-header .header-cell {
    text-align: center;
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
}

.row-header .header-cell:last-child {
    border-right: none;
}

/* Advanced Options Section */
.advanced-options-section {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--secondary-bg);
    overflow: hidden;
}

.advanced-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--dark-bg);
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.advanced-options-header:hover {
    background: var(--secondary-bg);
}

.advanced-options-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light-text);
}

.toggle-icon {
    font-size: 1.2rem;
    color: var(--accent);
    transition: transform 0.3s ease;
    font-weight: bold;
}

.advanced-options-header.expanded .toggle-icon {
    transform: rotate(180deg);
}

.advanced-options-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-bg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.advanced-options-content.collapsed {
    max-height: 0;
    padding: 0 1.5rem;
    border-top: none;
}

.advanced-options-content.expanded {
    max-height: 500px;
    padding: 1.5rem;
}

/* Sound Events Section */
.sound-events-section {
    margin: 2rem 0 1rem 0;
    padding: 1.5rem;
    background: var(--dark-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sound-events-section h4 {
    margin: 0 0 0.5rem 0;
    color: var(--light-text);
    font-size: 1.1rem;
    font-weight: 600;
}

.section-description {
    margin: 0 0 1.5rem 0;
    color: var(--light-text);
    opacity: 0.8;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sound-event-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.sound-event-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sound-event-field label {
    font-weight: 600;
    color: var(--light-text);
    font-size: 0.95rem;
}

.sound-selection-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.sound-select {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.sound-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.sound-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.sound-item {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.sound-item:hover {
    background: var(--dark-bg);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.sound-item.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.sound-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.sound-info {
    flex: 1;
    min-width: 0;
}

.sound-info h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sound-info p {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sound-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.sound-meta .duration {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(255, 213, 79, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.sound-meta .category {
    font-size: 0.7rem;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.sound-item.selected .duration {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.2);
}

.sound-item.selected .category {
    background: rgba(255, 255, 255, 0.2);
}

.sound-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.play-button {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--dark-text);
    font-size: 0.8rem;
}

.play-button:hover {
    background: #ffc107;
    transform: scale(1.1);
}

.play-button:active {
    transform: scale(0.95);
}

.play-icon {
    margin-left: 2px; /* Slight offset to center the triangle */
}

.select-button {
    background: var(--court-green);
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.select-button:hover {
    background: #145b2a;
    transform: translateY(-1px);
}

.select-button:active {
    transform: translateY(0);
}

/* Upload Progress Styles */
.upload-progress-container {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.upload-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.upload-status #uploadStatusText {
    font-weight: 500;
    color: var(--light-text);
}

.file-size {
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(255, 213, 79, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ffc107);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

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

.upload-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.upload-speed {
    color: var(--accent);
}

.time-remaining {
    color: rgba(255, 255, 255, 0.8);
}

/* Upload states */
.upload-progress-container.uploading .progress-fill {
    background: linear-gradient(90deg, var(--court-green), #2aa658);
}

.upload-progress-container.success .progress-fill {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.upload-progress-container.error .progress-fill {
    background: linear-gradient(90deg, var(--danger-bg), #e53e3e);
}

.upload-progress-container.error .upload-status #uploadStatusText {
    color: var(--danger-bg);
}

.catalogue-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.catalogue-filters .search-filter {
    flex: 1;
    min-width: 200px;
}

.catalogue-filters .category-filter {
    min-width: 150px;
}

.catalogue-filters select {
    width: 100%;
    padding: 0.5rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--light-text);
}

/* Responsive adjustments for sound events */
@media (max-width: 768px) {
    .sound-events-section {
        padding: 1rem;
    }
    
    .sound-selection-container {
        flex-direction: column;
    }
    
    .sound-select {
        min-width: 100%;
    }
    
    .sound-list {
        grid-template-columns: 1fr;
    }
    
    .catalogue-filters {
        flex-direction: column;
    }
    
    .catalogue-filters .search-filter,
    .catalogue-filters .category-filter {
        min-width: 100%;
    }
}

/* Responsive adjustments for row layout */
@media (max-width: 768px) {
    .group-container.row .group-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .group-container.row .group-card .group-actions {
        justify-content: center;
    }
    
    .row-header {
        display: none;
    }
    
    .advanced-options-header {
        padding: 0.8rem 1rem;
    }
    
    .advanced-options-content {
        padding: 1rem;
    }
    
    .advanced-options-content.expanded {
        padding: 1rem;
    }
}

/* Sound Catalogue Styles */
.sound-catalogue-container {
    padding: 1rem;
}

.catalogue-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.catalogue-filters .search-filter {
    flex: 1;
    min-width: 200px;
}

.catalogue-filters .category-filter {
    min-width: 150px;
}

.catalogue-filters select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--secondary-bg);
    border-radius: 4px;
    background: var(--dark-bg);
    color: var(--light-text);
}

.sound-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.sound-item {
    background: var(--dark-bg);
    border: 1px solid var(--secondary-bg);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sound-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sound-info {
    flex: 1;
}

.sound-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    line-height: 1.3;
}

.sound-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.sound-details {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.sound-duration {
    background: var(--accent);
    color: var(--dark-text);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.sound-category {
    background: var(--secondary-bg);
    color: var(--light-text);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.sound-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: auto;
}

.play-button {
    background: var(--accent);
    color: var(--dark-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.play-button:hover {
    background: #ffeb3b;
    transform: scale(1.1);
}

.play-icon {
    margin-left: 2px; /* Slight adjustment to center the triangle */
}

.select-button {
    background: #4caf50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
}

.select-button:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Responsive design for sound catalogue */
@media (max-width: 768px) {
    .sound-list {
        grid-template-columns: 1fr;
    }
    
    .catalogue-filters {
        flex-direction: column;
    }
    
    .catalogue-filters .search-filter,
    .catalogue-filters .category-filter {
        min-width: auto;
    }
    
    .sound-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .sound-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .select-button {
        width: 100%;
    }
}

/* Sound Event Configuration Styles */
.sound-event-config {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.sound-event-config h3 {
    margin-bottom: 0.5rem;
}

.sound-event-config p {
    margin-top: 0;
}

.sound-event-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--light-text);
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.toggle-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    margin-left: auto;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--light-text);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: var(--court-green);
    border-color: var(--court-green);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(26px);
    background: var(--light-text);
}

.toggle-text {
    flex: 1;
    font-size: 1rem;
    text-align: left;
    margin-right: auto;
}

.sound-event-toggle .form-help-text {
    margin-left: 0;
    margin-top: 0.5rem;
    padding-left: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive design for sound event config */
@media (max-width: 768px) {
    .sound-event-config {
        padding: 0.25rem;
        gap: 1rem;
        width: 100%;
    }
    
    .toggle-label {
        gap: 0.75rem;
        padding: 0.75rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .toggle-text {
        font-size: 0.9rem;
    }
    
    .sound-event-toggle .form-help-text {
        margin-left: 0;
        padding-left: 0.75rem;
        font-size: 0.8rem;
        width: 100%;
    }
}

/* --- Alarm Times Container --- */
.alarm-times-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alarm-time-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alarm-time-entry .time-input {
    flex: 0 0 100px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    font-size: 1rem;
    text-align: center;
}

.alarm-time-entry .time-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.2);
}

.alarm-time-entry .tag-select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    font-size: 0.9rem;
}

.alarm-time-entry .tag-select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.2);
}

.alarm-time-entry .tag-select option {
    background: var(--dark-bg);
    color: var(--light-text);
}

.alarm-time-entry .remove-btn {
    flex: 0 0 auto;
    padding: 0.5rem;
    background: var(--danger-bg);
    color: var(--light-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.alarm-time-entry .remove-btn:hover {
    background: #e53e3e;
}

.alarm-time-entry .remove-btn:disabled {
    background: var(--secondary-bg);
    cursor: not-allowed;
}

#addAlarmTimeBtn {
    margin-top: 0.5rem;
    background: var(--court-green);
    color: var(--light-text);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

#addAlarmTimeBtn:hover {
    background: #2aa658;
}

/* Responsive design for alarm times */
@media (max-width: 768px) {
    .alarm-time-entry {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .alarm-time-entry .time-input {
        flex: none;
        width: 100%;
    }
    
    .alarm-time-entry .tag-select {
        flex: none;
        width: 100%;
    }
    
    .alarm-time-entry .remove-btn {
        flex: none;
        width: 100%;
    }
}

