/* NRG Treningi – črna tema, živo rumena poudarka, bela pisava */
:root {
  --yellow: #FFEB3B;
  --yellow-hover: #FFF176;
  --yellow-dark: #F9A825;
}
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; padding: 0; background: #0a0a0a; color: #fff; min-height: 100vh; font-size: 18px; }
a { color: var(--yellow); text-decoration: underline; }
a:hover { color: var(--yellow-hover); }
a.btn-link.danger { color: #f87171; }
a.btn-link.danger:hover { color: #fca5a5; }

/* ----- Logo in header ----- */
.admin-header .logo-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.admin-header .header-logo { height: 40px; width: auto; display: block; }
.admin-header .header-title { font-size: 1.35rem; font-weight: 700; color: var(--yellow); }
.admin-header .logo-link:hover .header-title { color: var(--yellow-hover); }

/* ----- Prijava ----- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; background: #0a0a0a; }
.login-box { padding: 2rem; border-radius: 16px; max-width: 400px; width: 100%; }
.login-box h1 { margin: 0 0 0.25rem; font-size: 1.75rem; }
.login-box input { font-size: 1.1rem; padding: 0.75rem; }
.login-box button { padding: 0.85rem; font-size: 1.1rem; }
.login-box .error { color: #f87171; }

/* ----- Admin ----- */
.admin .admin-header { background: #171717; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-bottom: 1px solid #262626; }
.admin-header nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-header nav a { color: #fff; text-decoration: none; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 1.05rem; }
.admin-header nav a:hover { color: var(--yellow); background: rgba(255, 235, 59, 0.15); }
.admin-main { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }

.admin-main h2 { margin: 0 0 1rem; font-size: 1.5rem; color: var(--yellow); }
.admin-main h3 { margin: 1.25rem 0 0.5rem; font-size: 1.2rem; color: #fff; }
.card { background: #171717; border-radius: 14px; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid #262626; }
.section-label { margin: 0 0 0.75rem; font-weight: 600; color: #fff; font-size: 0.95rem; }

.form-card label { display: block; margin-top: 0.85rem; margin-bottom: 0.35rem; font-size: 1rem; color: #fff; }
.form-card input[type="text"],
.form-card input[type="number"],
.form-card input[type="date"],
.form-card input[type="file"],
.form-card select,
.form-card textarea { width: 100%; max-width: 500px; padding: 0.7rem 0.85rem; border: 1px solid #404040; border-radius: 10px; background: #262626; color: #fff; font-size: 1.05rem; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: none; border-color: var(--yellow); }
.form-card textarea { min-height: 70px; resize: vertical; }
.form-card button, .btn-primary { margin-top: 1rem; padding: 0.75rem 1.5rem; background: var(--yellow); color: #0a0a0a; border: none; border-radius: 10px; cursor: pointer; font-size: 1.05rem; min-height: 48px; font-weight: 600; }
.form-card button:hover, .btn-primary:hover { background: var(--yellow-hover); color: #0a0a0a; }
.form-card .btn-link { margin-left: 1rem; color: var(--yellow); text-decoration: none; font-size: 1rem; padding: 0.5rem 0; }
.form-card .btn-link:hover { color: var(--yellow-hover); }
.form-card .current-media { font-size: 0.9rem; color: #b0b0b0; margin-top: 0.5rem; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 1rem; color: #fff; }
.data-table th, .data-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #262626; }
.data-table th { color: #fff; font-weight: 600; }
.data-table a { margin-right: 1rem; padding: 0.35rem 0; }
.data-table a:hover { text-decoration: underline; }

.sortable-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.sortable-list li { padding: 0.65rem 0.85rem; background: #262626; margin-bottom: 0.35rem; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 1rem; gap: 0.5rem; }
.sortable-list li .ex-name { flex: 1; }
.sortable-list li .ex-actions { display: flex; align-items: center; gap: 0.25rem; }
.sortable-list .move-up, .sortable-list .move-down { padding: 0.35rem 0.5rem; font-size: 1rem; min-width: 32px; }
.sortable-list .remove-exercise { background: transparent; color: #737373; border: none; padding: 0.35rem 0.5rem; cursor: pointer; font-size: 1.25rem; line-height: 1; }
.sortable-list .remove-exercise:hover { color: #f87171; }

/* Sestava sklopa: vse vaje ob strani + izbrane vaje z gor/dol */
.block-exercises-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 0.5rem; }
@media (max-width: 600px) { .block-exercises-row { grid-template-columns: 1fr; } }
.exercise-pool label, .exercise-selected label { display: block; margin-bottom: 0.25rem; }
.exercise-pool .small, .exercise-selected .small { font-size: 0.85rem; margin: 0 0 0.5rem; }
.exercise-pool-list { list-style: none; padding: 0; margin: 0; max-height: 280px; overflow-y: auto; border: 1px solid #404040; border-radius: 12px; background: #1a1a1a; }
.exercise-pool-item { padding: 0.6rem 0.85rem; cursor: pointer; font-size: 0.95rem; border-bottom: 1px solid #262626; transition: background 0.15s; }
.exercise-pool-item:last-child { border-bottom: none; }
.exercise-pool-item { color: #fff; }
.exercise-pool-item:hover { background: #262626; color: var(--yellow); }
.exercise-selected .sortable-list { max-height: 280px; overflow-y: auto; }

/* Sklopi treninga */
.block-card { background: #262626; border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; border: 1px solid #404040; color: #fff; }
.block-badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; margin-right: 0.75rem; }
.block-badge.time { background: var(--yellow); color: #0a0a0a; }
.block-badge.reps { background: #404040; color: var(--yellow); }
.block-params { color: #fff; font-size: 0.95rem; }
.block-exercises-inline { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.95rem; color: #fff; }
.block-exercises-inline li::before { content: "· "; color: #737373; }
.block-form .radio-group { margin: 0.5rem 0; }
.block-form .radio-label { display: block; margin-bottom: 0.5rem; cursor: pointer; color: #fff; }
.block-form .radio-label input { width: auto; margin-right: 0.5rem; }
.btn-link.danger, .form-card .btn-link.danger { color: #f87171; }
.btn-link.danger:hover, .form-card .btn-link.danger:hover { color: #fca5a5; }
.admin-main h4 { margin: 1.25rem 0 0.5rem; font-size: 1.1rem; color: #fff; }

/* ----- Modali (popupi) ----- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.is-open { display: flex; }
#modal-block.modal-overlay { z-index: 1001; }
.modal { background: #171717; border-radius: 16px; border: 1px solid #262626; max-width: 520px; width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 48px rgba(0,0,0,0.5); }
.modal.modal-lg { max-width: 640px; }
.modal.modal-xl { max-width: 780px; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #262626; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { margin: 0; font-size: 1.25rem; color: #fff; font-weight: 600; }
.modal-close { width: 40px; height: 40px; border: none; background: transparent; color: #fff; cursor: pointer; border-radius: 10px; font-size: 1.5rem; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.modal-close:hover { color: var(--yellow); background: #262626; }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; color: #fff; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #262626; display: flex; gap: 0.75rem; flex-wrap: wrap; flex-shrink: 0; }
.modal-footer .btn-primary { margin-top: 0; }
.modal-footer .btn-secondary { margin-top: 0; background: #262626; color: #fff; }
.modal-footer .btn-secondary:hover { background: #404040; color: #fff; }

/* ----- Clean form controls (v modalu in povsod) ----- */
.form-card input[type="text"],
.form-card input[type="number"],
.form-card input[type="date"],
.form-card input[type="file"],
.form-card select,
.form-card textarea,
.modal select,
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="date"],
.modal textarea { width: 100%; max-width: 100%; padding: 0.75rem 1rem; border: 1px solid #404040; border-radius: 12px; background: #262626; color: #fff; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,235,59,0.25); }
.form-card select, .modal select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-card textarea, .modal textarea { min-height: 80px; resize: vertical; }
.modal .form-card label { margin-top: 1rem; margin-bottom: 0.4rem; color: #fff; }
.modal .form-card label:first-child { margin-top: 0; }
.page-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-actions h2 { margin: 0; }
.btn-secondary, a.btn-secondary { padding: 0.6rem 1.25rem; background: #262626; color: #fff; border: 1px solid #404040; border-radius: 10px; cursor: pointer; font-size: 1rem; font-weight: 500; text-decoration: none; display: inline-block; }
.btn-secondary:hover, a.btn-secondary:hover { background: #404040; color: #fff; text-decoration: none; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: none; background: #262626; color: #fff; cursor: pointer; font-size: 1.2rem; }
.btn-icon:hover { background: #404040; color: var(--yellow); }
.data-table .btn-link { margin-right: 0.75rem; }

/* ----- Nadzor ----- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.member-btn { display: flex; align-items: center; justify-content: center; min-height: 72px; padding: 1rem 1.25rem; background: #262626; color: #fff; text-decoration: none; border-radius: 12px; font-size: 1.15rem; font-weight: 500; border: 2px solid transparent; transition: background 0.2s, border-color 0.2s; }
.member-btn:hover { background: #404040; border-color: var(--yellow); color: var(--yellow); }
.member-btn.active { background: #292524; border-color: var(--yellow); color: var(--yellow); }

.control-workouts h3 { margin-top: 1rem; font-size: 1.15rem; color: #fff; }
.workout-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.workout-item { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1rem; background: #262626; margin-bottom: 0.5rem; border-radius: 10px; flex-wrap: wrap; color: #fff; }
.workout-name { flex: 1; min-width: 150px; font-size: 1.05rem; }
.workout-date { color: #b0b0b0; font-size: 0.95rem; }
.workout-item .btn-start-workout { padding: 0.6rem 1.25rem; background: var(--yellow); color: #0a0a0a; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; min-height: 44px; font-weight: 600; }
.workout-item .btn-start-workout:hover { background: var(--yellow-hover); color: #0a0a0a; }
.muted { color: #b0b0b0; font-size: 0.95rem; margin: 0.5rem 0; }

.control-status { margin: 0 0 1rem; color: #fff; font-size: 1.05rem; }
.control-buttons { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.control-buttons button { padding: 0.75rem 1.5rem; border: none; border-radius: 10px; font-size: 1.1rem; cursor: pointer; min-height: 52px; min-width: 120px; font-weight: 600; }
.control-buttons #btn-start { background: #22c55e; color: #fff; }
.control-buttons #btn-start:hover { background: #16a34a; }
.control-buttons #btn-pause { background: var(--yellow); color: #0a0a0a; }
.control-buttons #btn-pause:hover { background: var(--yellow-hover); color: #0a0a0a; }
.control-buttons #btn-reset { background: #525252; color: #fff; }
.control-buttons #btn-reset:hover { background: #404040; }
.control-buttons #btn-complete { background: var(--yellow); color: #0a0a0a; }
.control-buttons #btn-complete:hover { background: var(--yellow-hover); color: #0a0a0a; }
.display-link { margin-top: 1rem; }
.display-link a { color: var(--yellow); }
.display-link a:hover { color: var(--yellow-hover); }

/* ----- Display (TV) ----- */
.display-mode { margin: 0; padding: 0; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; background: #0a0a0a; }
.display-mode #display-app { flex: 1; display: flex; flex-direction: column; padding: 1.5rem; }
.display-header { margin-bottom: 1rem; }
.display-header .display-logo { height: clamp(36px, 6vw, 52px); width: auto; margin-bottom: 0.5rem; display: block; }
.display-header .member-name { font-size: clamp(1rem, 3vw, 1.5rem); color: #fff; display: block; margin-bottom: 0.25rem; }
.display-header .workout-name { margin: 0; font-size: clamp(1.25rem, 4vw, 2rem); font-weight: 700; color: var(--yellow); }
.display-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.current-exercise { width: 100%; max-width: 900px; }
.current-exercise h2 { font-size: clamp(1.5rem, 5vw, 3rem); margin: 0 0 1rem; color: #fff; }
.media-container { margin: 1rem 0; border-radius: 12px; overflow: hidden; background: #171717; min-height: 200px; display: flex; align-items: center; justify-content: center; border: 1px solid #262626; }
.media-container.rest { background: #262626; }
.media-container img, .media-container video { max-width: 100%; max-height: 50vh; object-fit: contain; }
.timer { font-size: clamp(3rem, 12vw, 6rem); font-weight: 700; margin: 1rem 0; letter-spacing: 0.02em; color: var(--yellow); }
.next-exercise { margin-top: 2rem; font-size: clamp(1rem, 2.5vw, 1.35rem); color: #b0b0b0; }
.next-exercise .label { margin-right: 0.5rem; }
.offline-msg { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: #b91c1c; color: #fff; padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.95rem; }
