/* =========================================================
   mobiel.css - Sprintgroep Swift Atletiek
   Laden NA sprint.css. Overschrijft alleen op schermen
   smaller dan 900px; daarboven blijft alles zoals het was.
   ========================================================= */

@media screen and (max-width: 900px)
{
	/* ---------- basis ---------- */

	*,
	*::before,
	*::after
	{
		box-sizing: border-box;
	}

	html
	{
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}

	/* Invoervelden minimaal 16px: voorkomt automatisch inzoomen op iPhone */
	input,
	select,
	textarea
	{
		font-size: 16px !important;
		max-width: 100%;
	}

	/* ---------- opbouw: header, menu, inhoud, gebruiker ---------- */

	#container
	{
		width: 100%;
		padding: 8px;
		display: flex;
		flex-direction: column;
	}

	/* De linkerkolom "opheffen", zodat menu en gebruikersblok
	   los van elkaar te ordenen zijn */
	#opbouwlinks
	{
		display: contents;
	}

	#header        { order: 1; }
	#opbouwlinks > .menu:not(#gebruiker) { order: 2; }
	#content       { order: 3; }
	#gebruiker     { order: 4; }
	#container > .clear { display: none; }

	#header
	{
		height: auto;
		padding: 10px 15px;
		border-radius: 20px;
		-moz-border-radius: 20px;
		-webkit-border-radius: 20px;
		box-shadow: 3px 3px 5px #aaa;
		background-size: cover;
	}

	h1
	{
		font-size: 22px;
		line-height: 1.3;
	}

	/* ---------- menu ---------- */

	.menu
	{
		width: 100%;
		margin: 12px 0 0 0;
		box-shadow: 3px 3px 5px #aaa;
	}

	.menu h2
	{
		width: auto;
		margin: -3px -3px 0 -3px;
	}

	.menu ul
	{
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
		padding: 10px 8px 0 8px;
	}

	.menu ul li
	{
		flex: 1 1 auto;
	}

	.menu ul li a
	{
		margin: 0;
		padding: 10px 12px;
		text-align: center;
		font-size: 14px;
		border: 1px solid #722a2e;
	}

	/* Geen vergroot-effect op touchscreens */
	.menu ul li a:hover
	{
		padding-left: 12px;
		transform: none;
		-ms-transform: none;
		-moz-transform: none;
		-webkit-transform: none;
		-o-transform: none;
		box-shadow: none;
	}

	/* ---------- gebruikersblok ---------- */

	#gebruiker
	{
		margin-top: 20px;
	}

	table.pr_lijst
	{
		min-width: 200px;
		font-size: 0.9em;
	}

	table.pr_lijst td
	{
		padding: 2px 8px;
	}

	/* ---------- inhoud ---------- */

	#content
	{
		float: none;
		width: 100%;
		margin: 15px 0 40px 0;
		padding: 0;
	}

	/* ---------- schema weergeven ---------- */

	div.schema div
	{
		float: none;
	}

	div.schema h4
	{
		width: auto;
	}

	div.schema div.tabel
	{
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	div.schema table
	{
		width: 100%;
		font-size: 0.75em;
		box-shadow: 3px 3px 5px #aaa;
	}

	/* De vaste breedtes uit de HTML (style="width:110px") opheffen */
	div.schema table td
	{
		width: auto !important;
		padding: 4px 3px;
	}

	td.totaal,
	td.duur
	{
		font-size: 1em;
		padding-right: 5px;
	}

	td.tekst
	{
		width: auto;
	}

	div.schema div.logboek
	{
		width: 100%;
		margin: 0 0 1.5em 0;
		font-size: 0.85em;
	}

	div.schema div.logboek h4
	{
		padding: 8px 0;
	}

	div.schema div.logboek textarea
	{
		width: 100%;
		margin-left: 0;
	}

	div.opm
	{
		width: auto;
	}

	/* ---------- popup ---------- */

	#popup
	{
		top: 10px;
		left: 10px;
		right: 10px;
		bottom: 10px;
		width: auto;
		min-width: 0;
		height: auto;
		min-height: 0;
		padding: 12px;
	}

	.button.b-close
	{
		right: 4px;
		top: 4px;
	}

	/* ---------- login ---------- */

	/* Op de loginpagina het menu (alleen "Inloggen") verbergen */
	#container:has(div.login) #opbouwlinks
	{
		display: none;
	}

	/* Loginblok gewoon in de pagina i.p.v. zwevend */
	div.login
	{
		position: static;
		width: 100%;
		max-width: 420px;
		margin: 25px auto 0 auto;
		padding-bottom: 15px;
		box-shadow: 3px 3px 5px #aaa;
	}

	div.login h2
	{
		width: auto;
		margin: -3px -3px 15px -3px;
	}

	/* Tabel opheffen: label boven het veld */
	div.login table,
	div.login tbody,
	div.login tr,
	div.login td
	{
		display: block;
		width: 100%;
	}

	div.login td.login
	{
		text-align: left !important;
		padding: 0 15px;
	}

	div.login label
	{
		display: block;
		margin: 8px 0 3px 0;
		font-size: 13px;
		font-weight: bold;
		color: #722a2e;
	}

	/* Lege cel voor de knop overslaan */
	div.login tr:last-child td:first-child
	{
		display: none;
	}

	div.login input[type=text],
	div.login input[type=password]
	{
		width: 100%;
		padding: 8px 12px;
		margin: 0;
	}

	div.login input[type=submit]
	{
		width: 100%;
		margin-top: 18px;
		padding: 10px 20px;
		color: #fff;
		background-color: #722a2e;
		border: none;
		font-weight: bold;
	}

	/* ---------- tempo / aanpassen ---------- */

	div.aanpassen
	{
		line-height: 1.6em;
		font-size: 1em;
		padding: 10px 12px;
		box-shadow: 3px 3px 5px #aaa;
	}

	/* Elk onderdeel van het keuzeformulier op een eigen regel */
	div.aanpassen form > label
	{
		display: block;
		margin-bottom: 10px;
	}

	div.aanpassen form > br
	{
		display: none;
	}

	/* Keuzelijsten (schema, atleet) over de volle breedte */
	div.aanpassen select
	{
		display: block;
		width: 100%;
		margin-top: 4px;
		padding: 6px 8px;
	}

	div.aanpassen input[type=text],
	div.aanpassen input[type=number]
	{
		width: 80px;
		padding: 4px 8px;
		margin: 0 4px;
	}

	/* Radioknoppen en vinkje: als tikbare "chips" naast elkaar */
	div.aanpassen form > label:has(input[type=radio]),
	div.aanpassen form > label:has(input[type=checkbox])
	{
		display: inline-flex;
		align-items: center;
		margin: 0 6px 8px 0;
		padding: 6px 10px;
		border: 1px solid #722a2e;
		border-radius: 15px;
		font-size: 0.9em;
	}

	div.aanpassen input[type=radio],
	div.aanpassen input[type=checkbox]
	{
		margin: 0 6px 0 0;
		width: 18px;
		height: 18px;
		accent-color: #722a2e;
	}

	div.aanpassen span
	{
		margin-left: 0;
	}

	/* Knop Aanpassen + printer onderaan op één regel */
	div.aanpassen input[type=submit],
	div.aanpassen input[type=button]
	{
		margin: 6px 0 0 0;
		padding: 8px 20px;
		color: #fff;
		background-color: #722a2e;
		border: none;
	}

	div.aanpassen img
	{
		height: 36px;
		margin-bottom: -12px;
	}

	div.aanpassen img.tempopic,
	div.aanpassen img.schemapic
	{
		margin-left: 15px;
	}

	table.tempo
	{
		display: block;
		overflow-x: auto;
	}

	/* ---------- schema invoeren ---------- */

	/* Kopblok (schema + datum): vaste breedte uit de HTML opheffen */
	div.aanpassen[style]
	{
		width: auto !important;
	}

	div.aanpassen > label
	{
		display: block;
		margin: 0 0 10px 0 !important;
	}

	div.aanpassen input[type=date]
	{
		display: block;
		width: 100%;
		margin-top: 4px;
		padding: 6px 8px;
	}

	/* Invoertabel: elke regel wordt een kaartje van 3 x 2 velden */
	table.si,
	table.si tbody,
	table.si tr,
	table.si td
	{
		display: block;
		width: 100%;
	}

	table.si
	{
		border-radius: 10px;
		overflow: hidden;
		box-shadow: 3px 3px 5px #aaa;
	}

	table.si tr.kop
	{
		display: none;
	}

	table.si tr
	{
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 8px 10px;
		padding: 10px;
		border-bottom: 2px solid #722a2e;
	}

	table.si tr:nth-child(odd)
	{
		background-color: #f6eeee;
	}

	table.si tr:last-child
	{
		border-bottom: none;
	}

	table.si td
	{
		border: none;
		padding: 0;
		text-align: left;
		white-space: nowrap;
	}

	/* Kolomnaam boven elk veld */
	table.si td::before
	{
		display: block;
		font-size: 11px;
		font-weight: bold;
		color: #722a2e;
		margin-bottom: 2px;
	}

	table.si td:nth-child(1)::before { content: "Aantal"; }
	table.si td:nth-child(2)::before { content: "Afstand"; }
	table.si td:nth-child(3)::before { content: "Tempo"; }
	table.si td:nth-child(4)::before { content: "Pauze"; }
	table.si td:nth-child(5)::before { content: "Serie pauze"; }
	table.si td:nth-child(6)::before { content: "Volgorde"; }

	/* Velden vullen de cel, met ruimte voor eenheid (m, %, s) */
	table.si input.aant,
	table.si input.afst,
	table.si input.temp,
	table.si input.pauze
	{
		width: calc(100% - 18px);
		padding: 6px 4px;
		background-color: #fff;
	}

	table.si td:nth-child(1) input,
	table.si td:nth-child(6) input
	{
		width: 100%;
	}

	/* Actief veld: rode achtergrond met witte tekst (zoals op desktop) */
	table.si input.tabel:focus
	{
		background-color: #722a2e;
		color: #fff;
	}

	/* Knoppen onder de tabel */
	#opmerkingen
	{
		height: 150px;
	}

	input.si_button
	{
		width: auto;
		margin: 15px 6px 0 0;
		padding: 10px 14px;
	}

	input.si_button[type=submit]
	{
		color: #fff;
		background-color: #722a2e;
		border: none;
		font-weight: bold;
	}

	#opmerkingen,
	.opmerking,
	#trainer_opmerking
	{
		width: 100%;
		box-shadow: 3px 3px 5px #aaa;
	}

	/* ---------- gebruiker bewerken ---------- */

	/* Label boven het veld, dubbele punten weg */
	div.gebruiker > span
	{
		display: none;
	}

	div.gebruiker label
	{
		display: block;
		width: auto;
		text-align: left;
		line-height: 1.4em;
		margin-top: 12px;
		margin-bottom: 3px;
		font-size: 13px;
		color: #722a2e;
	}

	div.gebruiker input,
	div.gebruiker select
	{
		width: 100%;
		padding: 7px 10px;
	}

	/* Geslacht: Man / Vrouw als knopjes naast elkaar */
	div.gebruiker label.radio
	{
		display: inline-flex;
		align-items: center;
		margin: 0 8px 0 0;
		padding: 6px 14px 6px 8px;
		border: 1px solid #722a2e;
		border-radius: 15px;
		font-size: 15px;
		font-weight: normal;
		color: #000;
	}

	div.gebruiker input[type=checkbox],
	div.gebruiker input[type=radio]
	{
		width: 20px;
		height: 20px;
		margin: 0 6px 0 0;
		padding: 0;
		accent-color: #722a2e;
		vertical-align: middle;
	}

	/* Actief / Trainer: label en vinkje op één regel */
	div.gebruiker label:has(+ span + input[type=checkbox])
	{
		display: inline-block;
		min-width: 70px;
		margin-top: 14px;
		font-size: 15px;
	}

	div.gebruiker label:has(+ span + input[type=checkbox]) + span + input[type=checkbox]
	{
		margin-left: 8px;
		vertical-align: -4px;
	}

	/* PR-blok: nette tabel met 3 kolommen (afstand | PR | werk PR) */
	div.gebruikerpr
	{
		width: 100%;
		margin: 25px 0 0 0;
		display: grid;
		grid-template-columns: 55px 1fr 1fr;
		gap: 8px 10px;
		align-items: center;
		box-shadow: 3px 3px 5px #aaa;
	}

	div.gebruikerpr br,
	div.gebruikerpr > span:not([class])
	{
		display: none;
	}

	div.gebruikerpr span.afstand,
	div.gebruikerpr span.pr,
	div.gebruikerpr span.werkpr
	{
		width: auto;
		margin: 0;
		padding: 0;
		font-size: 13px;
		color: #722a2e;
		text-align: left;
	}

	div.gebruikerpr span.afstand,
	div.gebruikerpr label
	{
		text-align: right;
	}

	div.gebruikerpr label
	{
		width: auto;
		line-height: 1.4em;
	}

	div.gebruikerpr input
	{
		width: 100%;
		margin: 0;
		padding: 6px 8px;
	}

	input[type=submit].opslaan
	{
		margin: 20px 0 0 0;
		width: 100%;
		padding: 10px;
		color: #fff;
		background-color: #722a2e;
		border: none;
		font-weight: bold;
	}

	/* ---------- atleten ---------- */

	table.atleten
	{
		display: block;
		overflow-x: auto;
		max-width: 100%;
	}

	table.atleten tr td
	{
		font-size: 0.85em;
		padding: 6px 8px;
	}

	span.nieuwe_atleet a
	{
		padding: 10px 18px;
	}

	/* ---------- atletenlijst (pagina Atleten) ---------- */
	/* Elke atleet wordt een kaartje; alleen op de pagina met "Nieuwe Atleet" */

	#content:has(.nieuwe_atleet) table.atleten,
	#content:has(.nieuwe_atleet) table.atleten tbody
	{
		display: block;
		width: 100%;
		border: none;
		box-shadow: none;
		overflow: visible;
	}

	#content:has(.nieuwe_atleet) table.atleten tr.kop,
	#content:has(.nieuwe_atleet) table.atleten tr:empty
	{
		display: none;
	}

	#content:has(.nieuwe_atleet) table.atleten tr
	{
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 6px 12px;
		margin-bottom: 12px;
		padding: 10px 12px;
		border: 2px solid #722a2e;
		border-radius: 12px;
		box-shadow: 3px 3px 5px #aaa;
		background-color: #fff;
	}

	/* Niet-actieve atleten iets lichter */
	#content:has(.nieuwe_atleet) table.atleten tr:has(td:nth-child(3):empty)
	{
		opacity: 0.6;
		border-color: #b98a8c;
	}

	/* Geen rode hover-balk op kaartjes */
	#content:has(.nieuwe_atleet) table.atleten tr:hover,
	#content:has(.nieuwe_atleet) table.atleten tr:hover td
	{
		background-color: #fff;
		color: #333;
	}

	#content:has(.nieuwe_atleet) table.atleten tr:hover a
	{
		color: #722a2e;
	}

	#content:has(.nieuwe_atleet) table.atleten td
	{
		display: block;
		border: none;
		padding: 0;
		font-size: 14px;
		color: #333;
	}

	/* Naam: groot, bovenaan links */
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(1)
	{
		grid-column: 1;
		grid-row: 1;
		font-size: 17px;
		font-weight: bold;
		padding-bottom: 4px;
		border-bottom: 1px solid #e3cfd0;
	}

	#content:has(.nieuwe_atleet) table.atleten td:nth-child(1) a
	{
		display: block;
		color: #722a2e;
	}

	/* Actief: "X" wordt een label rechtsboven */
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(3)
	{
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
		align-self: start;
		font-size: 0;
		text-align: right !important;
		border-bottom: none;
	}

	#content:has(.nieuwe_atleet) table.atleten td:nth-child(3):not(:empty)::after
	{
		content: "Actief";
		display: inline-block;
		font-size: 12px;
		font-weight: bold;
		color: #fff;
		background-color: #722a2e;
		padding: 3px 10px;
		border-radius: 10px;
	}

	#content:has(.nieuwe_atleet) table.atleten td:nth-child(3):empty::after
	{
		content: "Niet actief";
		display: inline-block;
		font-size: 12px;
		color: #722a2e;
		border: 1px solid #722a2e;
		padding: 2px 9px;
		border-radius: 10px;
	}

	/* Overige gegevens met een klein label erboven */
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(n+2):not(:nth-child(3))::before
	{
		display: block;
		font-size: 11px;
		font-weight: bold;
		color: #722a2e;
	}

	#content:has(.nieuwe_atleet) table.atleten td:nth-child(2)::before { content: "Categorie"; }
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(4)::before { content: "Schema"; }
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(5)::before { content: "Jaar"; }
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(6)::before { content: "Afstand"; }
	#content:has(.nieuwe_atleet) table.atleten td:nth-child(7)::before { content: "Laatste actie"; }

	#content:has(.nieuwe_atleet) table.atleten td:nth-child(7)
	{
		grid-column: 1 / -1;
		font-size: 12px;
		color: #666;
	}

	span.nieuwe_atleet
	{
		display: block;
		margin-bottom: 15px;
	}

	/* ---------- tempokaart (pagina Tempo's) ---------- */
	/* Alleen op de pagina met het tempo-formulier, niet op Atleten */

	#content:has(#tempo_form) table.atleten
	{
		max-height: 75vh;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		border-collapse: separate;
		border-spacing: 0;
		box-shadow: 3px 3px 5px #aaa;
		margin-top: 15px;
	}

	#content:has(#tempo_form) table.atleten td
	{
		font-size: 13px;
		padding: 6px 8px;
		white-space: nowrap;
		text-align: center;
		background-color: #fff;
		border: none;
		border-right: 1px solid #e3cfd0;
		border-bottom: 1px solid #e3cfd0;
	}

	/* Om en om gekleurde rijen voor leesbaarheid */
	#content:has(#tempo_form) table.atleten tr:nth-child(odd) td
	{
		background-color: #f6eeee;
	}

	/* Kopregel (percentages) blijft bovenaan staan bij scrollen */
	#content:has(#tempo_form) table.atleten tr.kop td
	{
		position: sticky;
		top: 0;
		z-index: 2;
		background-color: #722a2e;
		color: #fff;
		border-color: #8e4a4e;
	}

	/* Eerste kolom (afstand) blijft links staan bij scrollen,
	   zelfde opmaak als de rest van de tabel */
	#content:has(#tempo_form) table.atleten td:first-child
	{
		position: sticky;
		left: 0;
		z-index: 1;
		border-right: 2px solid #722a2e;
	}

	/* Hoekcel boven beide */
	#content:has(#tempo_form) table.atleten tr.kop td:first-child
	{
		z-index: 3;
	}

	/* Geen rode hover-balk op touch; tikken markeert alleen de rij licht */
	#content:has(#tempo_form) table.atleten tr:hover td
	{
		background-color: #e9d4d5;
		color: #722a2e;
	}

	#content:has(#tempo_form) table.atleten tr.kop:hover td
	{
		background-color: #722a2e;
		color: #fff;
	}

	/* Formulier: label + veld bij elkaar op één regel */
	#tempo_form > label
	{
		display: inline-block;
		white-space: nowrap;
		margin: 0 6px 10px 0;
	}

	#tempo_form select
	{
		display: inline-block;
		width: auto;
		margin: 0 0 0 4px;
	}

	#tempo_form input[type=submit]
	{
		margin-top: 0;
	}

	/* ---------- enquete ---------- */

	#enquete table,
	#enquete tbody,
	#enquete > table > tbody > tr,
	#enquete > table > tbody > tr > td
	{
		display: block;
		width: 100%;
	}

	#enquete tr td:first-child
	{
		text-align: left;
	}

	#enquete input,
	#enquete select
	{
		width: 100%;
	}

	#enquete input[type=checkbox],
	#enquete input[type=radio]
	{
		width: auto;
	}

	#enquete tr td table
	{
		display: inline-table;
		width: auto;
		top: 0;
		padding-left: 0;
	}

	/* Overzicht vragenlijsten: elke regel wordt een kaartje */
	a.enquete_link
	{
		display: inline-block;
		padding: 10px 18px;
		color: #fff !important;
		background-color: #722a2e;
		border-radius: 15px;
		box-shadow: 3px 3px 5px #aaa;
	}

	.enquete_overzicht,
	.enquete_overzicht tbody
	{
		display: block;
		width: 100%;
	}

	.enquete_overzicht thead
	{
		display: none;
	}

	.enquete_overzicht tr
	{
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 4px 10px;
		margin-bottom: 12px;
		padding: 10px 12px;
		border: 2px solid #722a2e;
		border-radius: 12px;
		box-shadow: 3px 3px 5px #aaa;
		background-color: #fff;
	}

	.enquete_overzicht td
	{
		display: block;
		padding: 0;
	}

	/* Geen rode hover op kaartjes */
	.enquete_overzicht tr:hover td
	{
		background-color: transparent;
		color: inherit;
	}

	/* Naam groot, datum klein eronder */
	.enquete_overzicht td:nth-child(1)
	{
		grid-column: 1 / -1;
		font-size: 17px;
		font-weight: bold;
		color: #722a2e;
	}

	.enquete_overzicht td:nth-child(2)
	{
		grid-column: 1 / -1;
		font-size: 12px;
		color: #666;
		margin-bottom: 6px;
	}

	/* Bekijken / Afdrukken als twee knoppen naast elkaar */
	.enquete_overzicht td:nth-child(3) a,
	.enquete_overzicht td:nth-child(4) a
	{
		display: block;
		text-align: center;
		padding: 9px 0;
		border-radius: 12px;
		border: 2px solid #722a2e;
	}

	.enquete_overzicht td:nth-child(3) a,
	.enquete_overzicht tr:hover td:nth-child(3) a
	{
		color: #fff;
		background-color: #722a2e;
	}

	.enquete_overzicht td:nth-child(4) a,
	.enquete_overzicht tr:hover td:nth-child(4) a
	{
		color: #722a2e;
		background-color: #fff;
	}

	/* Trainer zichtbaar: alleen tonen als er iets in staat */
	.enquete_overzicht td:nth-child(5)
	{
		grid-column: 1 / -1;
		font-size: 12px;
		margin-top: 4px;
	}

	.enquete_overzicht td:nth-child(5):empty
	{
		display: none;
	}

	.enquete_overzicht td:nth-child(5)::before
	{
		content: "Trainer zichtbaar: ";
		font-weight: bold;
		color: #722a2e;
	}

	/* ---------- logboek / zijpaneel ---------- */

	section.logboek
	{
		width: 100%;
	}

	/* Zorgt dat iPhone/Android een tik als "hover" doorgeeft aan het script */
	section.logboek
	{
		cursor: pointer;
		-webkit-tap-highlight-color: rgba(114, 42, 46, 0.15);
	}

	section.logboek:hover
	{
		background-color: #e9d4d5;
	}

	/* Schema-venster: vast onderin beeld in plaats van naast de muis.
	   top/left worden door logboek.js inline gezet, daarom !important */
	aside#schema
	{
		position: fixed;
		top: auto !important;
		left: 8px !important;
		right: 8px;
		bottom: 8px;
		width: auto;
		max-height: 60vh;
		overflow-y: auto;
		margin: 0;
		z-index: 1000;
		box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.35);
	}

	aside#schema div.schema table
	{
		width: 100%;
	}
}

/* Extra klein (telefoon staand) */
@media screen and (max-width: 420px)
{
	h1
	{
		font-size: 18px;
	}

	.menu ul li a
	{
		font-size: 13px;
		padding: 9px 8px;
	}

	div.schema table
	{
		font-size: 0.7em;
	}
}
