@import "/css/theme.css";

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Login ---------- */
.user-login-body {
    background: var(--login_background);
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
	& > .logo{
		position: absolute;
		top: 1rem;
		right: 1rem;
		& > img {
			content: var(--login-slogo);
		}
	}
}

.user-login-container {
    background: var(--login_form_background_color);
    backdrop-filter: blur(10px);
    padding: 2.5rem 2rem 4rem 2rem;
    border-radius: var(--login_form_radius);
    box-shadow: var(--login_form_shadow);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.operator_mode {
	position: absolute;
	bottom: 0.5rem;
	left: 1rem;
	color: rgba(255,255,255,0.6);
	font-size: 90%;
	cursor: pointer;
	
	& > svg {
		position: relative;
		top: 3px;
	}
}
.operator_mode:hover {
	color: rgba(255,255,255,1.0);
	font-size: 100%;
	transition: color 0.2s, font-size 0.2s;
}

.user-login-logo{ 
	& > div {
		& > img {
			height: 55px;
		}
		& > span {
			color: white;
			font-size: 140%;
		}
		margin-bottom: 0.5rem;
	}

	& > h1 {
		color: white;
		font-size: 1.4rem;
		margin-bottom: 2rem;
		font-weight: 300;
		letter-spacing: 1px;
	}
}

.user-login-form .input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.user-login-form label {
    display: block;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.user-login-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--login_controls_radius);
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.35);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
}

.user-login-form input:focus {
    border-color: var(--login_button_color);
    background: rgba(0,0,0,0.45);
}

.user-login-form input::placeholder {
    color: rgba(255,255,255,0.35);
}

#user-plate { text-transform: uppercase; }

.user-login-btn {
	flex-grow: 1;
    padding: 0.9rem;
    border-radius: var(--login_controls_radius);
    border: none;
    background: var(--login_button_color);
    color: white;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: var(--login_controls_shadow);
    transition: filter 0.2s, transform 0.1s;
}

.user-login-btn:active {
    transform: scale(0.97);
}

.login-error {
    color: #ff8787;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    display: none;
    min-height: 1.2rem;
}

/* ---------- Main App ---------- */
.user-main-body {
    /*background: var(--interface_background);*/
	background: #2C3E50;
    /*min-height: 100vh;*/
    color: white;
    overflow: hidden;
	display: flex;
	flex-direction: column;
	width: 100%;
	position: absolute;
	top: 0px;
	bottom: 0px;
}

.logo {
	align-content: center;
	text-align: center;
	height: 3rem;
	background-color: transparent; /*rgba(0,0,0,0.15); */
	& > img {
		content: var(--slogo);
		height: 2rem;
	}
}

.user-app {
    display: flex;
    flex-direction: column;
    /*height: 100vh;*/
    max-width: 600px;
    flex-grow: 1;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.user-header-logo {
    height: 1.8rem;
}

.user-header-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
}

.user-icon-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-dashboard {
    flex: 1;
/*    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    padding: 1.2rem;
	*/
	display: flex;
	flex-direction: column;
    align-content: center;
	gap: 0.7rem;
    padding: 0.8rem;
}

.user-big-btn {
    /*background: var(--button_background);*/
	flex-grow: 1;
	background: #3498DB;
    border: var(--button_border);
    border-radius: 0.5rem;
    color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 1rem;
    transition: transform 0.15s, background 0.2s;
    box-shadow: var(--button_shadow);
    outline: none;
    -webkit-touch-callout: none;
	max-height: 15rem;
	
	& > .icon {
		font-size: 2.8rem;
		line-height: 1;
		flex: 1;
		max-width: 2.4rem;
		margin-left: 1rem;
	}
	& > div {
		flex: 4;
		display: flex;
		flex-direction: column;
		& > .label {
			font-size: 1.05rem;
			font-weight: 600;
			margin-top: 0.2rem;
		}

		& > .sub {
			font-size: 0.7rem;
			opacity: 0.65;
			text-align: center;
			font-weight: 300;
		}
	}
}

.user-big-btn:disabled{
	opacity: 0.4;
}

.user-big-btn:active {
    transform: scale(0.96);
	background: transparent;
	border: 2px solid #3498DB;
	box-shadow: 0 0 5px #00a2ff, 0 0 15px #00a2ff, 0 0 30px #00a2ff, inset 0 0 10px #00a2ff;
	text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
	transition: all 0.3s ease;
}



/* ---------- Dialogs ---------- */
.user-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
}

.user-dialogs {
    position: fixed;
    inset: 0;
    z-index: 101;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.user-dialog {
    background: var(--dialog_background);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--dialog_border_radius);
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    pointer-events: auto;
}

.user-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.user-dialog-header h2 {
    font-size: 1.15rem;
    font-weight: 500;
    color: white;
}

.user-dialog-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.6rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    line-height: 1;
    transition: color 0.2s;
}

.user-dialog-close:hover {
    color: white;
}

.user-dialog-body {
    padding: 1.2rem;
    overflow-y: auto;
    color: rgba(255,255,255,0.9);
}

.user-dialog-body .input-group {
    margin-bottom: 1rem;
}

.user-dialog-body label {
    display: block;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.user-dialog-body input,
.user-dialog-body select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25);
    color: white;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.user-dialog-body input:focus,
.user-dialog-body select:focus {
    border-color: var(--login_button_color);
}

.user-dialog-body input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* ---------- Vehicles ---------- */
.vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
    max-height: 50vh;
    overflow-y: auto;
}

.vehicle-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.6rem;
    padding: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.vehicle-card:active {
    background: rgba(255,255,255,0.08);
}

.vehicle-plate {
    font-family: 'Outfit', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.vehicle-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: capitalize;
}

.vehicle-type-icon {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

.vehicle-actions {
    display: flex;
    gap: 0.4rem;
}

.empty-msg {
    text-align: center;
    color: rgba(255,255,255,0.4);
    padding: 2.5rem 1rem;
    font-size: 0.95rem;
}

.user-action-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255,255,255,0.06);
    border: 1px dashed rgba(255,255,255,0.2);
    color: white;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.user-action-btn:active {
    background: rgba(255,255,255,0.12);
}

/* Vehicle type icons (reuse existing sprite classes if available, fallback inline) */
.typecar        { background-image: url('/img/car.png'); }
.typemotorbike  { background-image: url('/img/motorbike.png'); }
.typemotorcicle { background-image: url('/img/motorcycle.png'); }
.typetruck      { background-image: url('/img/truck.png'); }
.typevan        { background-image: url('/img/van.png'); }
.typecamper     { background-image: url('/img/camper.png'); }
.typetrailer    { background-image: url('/img/trailer.png'); }
.typecaravan    { background-image: url('/img/caravan.png'); }
.typevehicle    { background-image: url('/img/vehicle.png'); }

/* ---------- Responsive ---------- */
@media (max-width: 400px) {
    .user-dashboard {
        gap: 0.7rem;
        padding: 0.8rem;
    }
    .user-big-btn .icon {
        font-size: 2.2rem;
    }
    .user-big-btn .label {
        font-size: 0.95rem;
    }
    .user-login-container {
        padding: 2.5rem 2rem 4rem 2rem;
    }
}

@media (max-height: 700px) {
    .user-big-btn {
        padding: 0.7rem;
    }
    .user-big-btn .icon {
        font-size: 2.2rem;
    }
}

/* ---------- Passes and bookings ---------- */
.passes-validity {
    color: white;
    font-weight: 600;
    margin: 0 0 0.8rem;
}

.passes-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
    max-height: 45vh;
    overflow-y: auto;
}

.purchase-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.6rem;
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.purchase-card.canceled { opacity: 0.55; }
.purchase-name { color: white; font-weight: 600; }
.purchase-meta { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 0.2rem; }
#dialog-passes .user-action-btn { margin-top: 0.5rem; }
#dialog-buy .user-dialog-body { overflow-y: auto; }
.buy-check { margin: 0.4rem 0 0.6rem; font-weight: 600; min-height: 1.2rem; }
.buy-check.ok { color: #7ee2a1; }
.buy-check.error { color: #ff9b8f; }
.buy-accounts .user-login-btn { margin-top: 0.5rem; }
