@use "../shared/variables" as *;

:root {
	--bg-radial: radial-gradient(circle at top, #1e1b4b 0%, #0b0f19 100%);
	--bg-glass: rgba(17, 24, 39, 0.7);
	--bg-glass-card: rgba(30, 41, 59, 0.5);
	--border-glass: rgba(255, 255, 255, 0.08);
	--border-glass-focus: #{ rgba($ndizi-orchid, 0.5) };

	--text-primary: #f8fafc;
	--text-secondary: #94a3b8;
	--text-muted: #64748b;

	--ndizi-orchid: #{ $ndizi-orchid };
	--color-indigo: #{ $ndizi-orchid };
	--color-indigo-glow: #{ rgba($ndizi-orchid, 0.25) };
	--color-yellow: #{ $ndizi-yellow };
	--color-yellow-glow: #{ rgba($ndizi-yellow, 0.2) };
	--color-red: #ef4444;
	--color-red-glow: rgba(239, 68, 68, 0.25);
	--color-emerald: #10b981;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	background: var(--bg-radial);
	color: var(--text-primary);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 24px 16px;
	overflow-y: auto;
}

/* Custom Thin Scrollbar */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.2);
}

.app-container {
	width: 100%;
	max-width: 380px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Glassmorphism Card Wrapper */
.glass-card {
	background: var(--bg-glass);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--border-glass);
	border-radius: 20px;
	padding: 24px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* App Header */
.app-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}

.app-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.app-logo {
	width: 32px;
	height: 32px;
	filter: drop-shadow(0 0 8px rgba($ndizi-yellow, 0.35));
	flex-shrink: 0;
}

.app-title {
	font-family: Outfit, sans-serif;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.5px;
	background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.app-status {
	font-size: 11px;
	background: rgba($ndizi-orchid, 0.15);
	color: var(--color-indigo);
	border: 1px solid rgba($ndizi-orchid, 0.3);
	padding: 3px 8px;
	border-radius: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* Install App Banner */
.install-banner {
	display: none;
	background: linear-gradient(135deg, rgba($ndizi-orchid, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
	border: 1px solid rgba($ndizi-orchid, 0.3);
	border-radius: 14px;
	padding: 12px 16px;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.install-text {
	font-size: 13px;
	color: var(--text-primary);
	font-weight: 500;
}

.install-btn {
	background: var(--color-indigo);
	color: #fff;
	border: none;
	padding: 6px 12px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.install-btn:hover {
	background: $ndizi-plum;
	box-shadow: 0 0 10px rgba($ndizi-orchid, 0.4);
}

/* Mode Tabs */
.mode-tabs {
	display: flex;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 10px;
	padding: 3px;
	margin-bottom: 8px;
}

.tab-btn {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--text-secondary);
	padding: 8px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.tab-btn svg {
	width: 16px;
	height: 16px;
}

.tab-btn.active {
	background: var(--bg-glass-card);
	color: var(--text-primary);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Form Controls */
.form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.form-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.form-select,
.form-input {
	width: 100%;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--border-glass);
	color: var(--text-primary);
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: all 0.2s;
}

.form-select:focus,
.form-input:focus {
	border-color: var(--border-glass-focus);
	box-shadow: 0 0 0 2px var(--color-indigo-glow);
}

select.form-select {
	appearance: none;
	-webkit-appearance: none;
	/* stylelint-disable-next-line function-url-quotes */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px;
	padding-right: 40px;
}

select.form-select option {
	background: #0f172a;
	color: var(--text-primary);
}

/* Billable Toggle */
.toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 0;
	margin-bottom: 20px;
}

.toggle-label-text {
	font-size: 13px;
	font-weight: 500;
	color: var(--text-secondary);
}

.switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(255, 255, 255, 0.1);
	transition: 0.3s;
	border-radius: 24px;
	border: 1px solid var(--border-glass);
}

.slider::before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 3px;
	bottom: 3px;
	background-color: var(--text-secondary);
	transition: 0.3s;
	border-radius: 50%;
}

input:checked + .slider {
	background-color: var(--color-indigo);
	border-color: rgba($ndizi-orchid, 0.4);
}

input:checked + .slider::before {
	transform: translateX(20px);
	background-color: #fff;
}

/* Buttons */
.btn {
	width: 100%;
	border: none;
	border-radius: 12px;
	padding: 13px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.25s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.btn svg {
	width: 18px;
	height: 18px;
}

.btn-primary {
	background: var(--color-indigo);
	color: #fff;
	box-shadow: 0 4px 14px var(--color-indigo-glow);
}

.btn-primary:disabled {
	background: rgba(255, 255, 255, 0.05);
	color: var(--text-muted);
	cursor: not-allowed;
	box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
	background: $ndizi-plum;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba($ndizi-orchid, 0.4);
}

.btn-danger {
	background: var(--color-red);
	color: #fff;
	box-shadow: 0 4px 14px var(--color-red-glow);
}

.btn-danger:hover {
	background: #dc2626;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Manual Log Duration Block */
.manual-panel {
	display: none;
	flex-direction: column;
	gap: 12px;
}

.duration-inputs {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(0, 0, 0, 0.15);
	padding: 12px;
	border-radius: 12px;
	border: 1px solid var(--border-glass);
}

.duration-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	width: 70px;
}

.duration-col input {
	width: 100%;
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--border-glass);
	color: #fff;
	border-radius: 8px;
	text-align: center;
	padding: 8px;
	font-size: 18px;
	font-weight: 700;
	outline: none;
}

.duration-col input:focus {
	border-color: var(--border-glass-focus);
}

.duration-col span {
	font-size: 10px;
	color: var(--text-secondary);
	font-weight: 600;
	text-transform: uppercase;
}

.duration-sep {
	font-size: 24px;
	font-weight: 700;
	color: var(--text-muted);
	margin-top: -16px;
}

.manual-date-section {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 8px 0;
	text-align: center;
}

.manual-date-change-btn {
	background: none;
	border: none;
	color: $ndizi-orchid;
	cursor: pointer;
	font-size: 12px;
	padding: 0;
	text-decoration: underline;

	&:hover {
		color: $ndizi-yellow;
	}
}

.manual-date-input {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	color: inherit;
	color-scheme: dark;
	font-size: 12px;
	padding: 3px 8px;
	text-align: center;

	&::-webkit-calendar-picker-indicator {
		cursor: pointer;
		filter: brightness(0) invert(1);
		opacity: 0.7;

		&:hover {
			opacity: 1;
		}
	}

	&:disabled {
		cursor: default;
		opacity: 0.5;

		&::-webkit-calendar-picker-indicator {
			display: none;
		}
	}
}

/* Running Clock Animation */
.active-panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: center;
}

.active-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
}

.active-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.badge {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 12px;
}

.badge-project {
	background: rgba($ndizi-orchid, 0.15);
	color: #a5b4fc;
	border: 1px solid rgba($ndizi-orchid, 0.3);
}

.badge-task {
	background: rgba(255, 255, 255, 0.05);
	color: var(--text-secondary);
	border: 1px solid var(--border-glass);
}

.active-desc {
	font-size: 13px;
	color: var(--text-secondary);
	text-align: center;
	font-style: italic;
	margin-top: 4px;
	word-break: break-word;
}

.ticker-clock {
	font-family: Outfit, sans-serif;
	font-size: 44px;
	font-weight: 700;
	letter-spacing: 1px;
	background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
	margin: 6px 0;
	font-variant-numeric: tabular-nums;
}

.timer-running .ticker-clock {
	background: linear-gradient(135deg, var(--color-yellow) 0%, #fbbf24 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: pulse-glow 2.5s infinite ease-in-out;
}

@keyframes pulse-glow {

	0%,
	100% {
		text-shadow: 0 0 10px rgba(234, 179, 8, 0.1);
		opacity: 0.95;
	}

	50% {
		text-shadow: 0 0 25px rgba(234, 179, 8, 0.55);
		opacity: 1;
	}
}

/* Recent Logs List */
.recent-section {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.section-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.section-title {
	font-size: 12px;
	font-weight: 700;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.recent-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 180px;
	overflow-y: auto;
	padding-right: 4px;
}

.log-item {
	background: rgba(0, 0, 0, 0.18);
	border: 1px solid var(--border-glass);
	border-radius: 12px;
	padding: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	transition: all 0.2s;
}

.log-item:hover {
	background: rgba(0, 0, 0, 0.25);
	border-color: rgba(255, 255, 255, 0.12);
}

.log-details {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1;
	min-width: 0;
}

.log-proj-task {
	font-size: 12px;
	font-weight: 600;
	color: #a5b4fc;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.log-desc {
	font-size: 12px;
	color: var(--text-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.log-meta {
	font-size: 10px;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 6px;
}

.log-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.log-duration {
	font-size: 14px;
	font-weight: 700;
	color: var(--text-primary);
	font-variant-numeric: tabular-nums;
}

.btn-delete {
	background: transparent;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.btn-delete:hover {
	color: var(--color-red);
	background: rgba(239, 68, 68, 0.1);
}

.btn-delete svg {
	width: 15px;
	height: 15px;
}

.empty-logs {
	text-align: center;
	padding: 24px;
	font-size: 12px;
	color: var(--text-muted);
	border: 1px dashed var(--border-glass);
	border-radius: 12px;
}

/* Footer Branding */
.app-footer {
	text-align: center;
	margin-top: 8px;
}

.footer-link {
	color: var(--text-muted);
	text-decoration: none;
	font-size: 11px;
	font-weight: 500;
	transition: color 0.2s;
}

.footer-link:hover {
	color: var(--text-secondary);
}

@media (max-width: 480px) {

	body {
		padding: 12px 8px;
	}

	.app-container {
		max-width: 100%;
		gap: 16px;
	}

	.glass-card {
		padding: 20px 16px;
	}

	.timer-display {
		font-size: 40px !important;
	}
}
