/*
 * TeamTablely – Frontend Styles
 * Prefixed with .teamtablely- to avoid Divi/theme conflicts.
 */

/* =========================================================
   Reset & Base
   ========================================================= */

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

.teamtablely-wrap {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #1f2937;
	-webkit-font-smoothing: antialiased;
}

/* =========================================================
   Card
   ========================================================= */

.teamtablely-card {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	padding: 40px 36px;
	max-width: 600px;
	margin: 0 auto 32px;
}

@media (max-width: 640px) {
	.teamtablely-card {
		padding: 28px 20px;
		border-radius: 12px;
	}
}

.teamtablely-card__icon {
	font-size: 40px;
	margin-bottom: 12px;
	display: block;
	text-align: center;
}

.teamtablely-card__title {
	font-size: 1.6rem !important;
	font-weight: 700 !important;
	text-align: center !important;
	margin: 0 0 8px !important;
	color: #111827 !important;
	line-height: 1.3 !important;
}

.teamtablely-card__subtitle {
	text-align: center;
	color: #6b7280;
	margin: 0 0 28px !important;
	font-size: 0.95rem;
}

/* =========================================================
   Form Elements
   ========================================================= */

.teamtablely-form-group {
	margin-bottom: 20px;
}

.teamtablely-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.teamtablely-required {
	color: #ef4444;
	margin-left: 2px;
}

.teamtablely-input {
	width: 100%;
	padding: 11px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	font-size: 0.95rem;
	color: #1f2937;
	background: #f9fafb;
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
	font-family: inherit;
}

.teamtablely-input:focus {
	border-color: #6366f1;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.teamtablely-input--large {
	padding: 16px 18px;
	font-size: 1.15rem;
	border-radius: 12px;
}

.teamtablely-textarea {
	resize: vertical;
	min-height: 80px;
	font-family: 'Courier New', monospace;
	font-size: 0.85rem;
}

/* =========================================================
   File Drop Zone
   ========================================================= */

.teamtablely-file-drop {
	position: relative;
	border: 2px dashed #d1d5db;
	border-radius: 12px;
	background: #f9fafb;
	transition: border-color 0.2s, background 0.2s;
	cursor: pointer;
}

.teamtablely-file-drop:hover,
.teamtablely-file-drop.is-dragover {
	border-color: #6366f1;
	background: #eef2ff;
}

.teamtablely-file-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.teamtablely-file-drop__inner {
	padding: 32px 20px;
	text-align: center;
	pointer-events: none;
}

.teamtablely-file-drop__icon {
	font-size: 32px;
	display: block;
	margin-bottom: 8px;
}

.teamtablely-file-drop__text {
	font-size: 0.9rem;
	color: #374151;
	margin: 0 0 4px !important;
}

.teamtablely-file-drop__hint {
	font-size: 0.8rem;
	color: #9ca3af;
	margin: 0 !important;
}

.teamtablely-file-drop__selected {
	padding: 12px 16px;
	background: #eef2ff;
	border-radius: 10px;
	font-size: 0.875rem;
	color: #4338ca;
	font-weight: 500;
	text-align: center;
}

/* =========================================================
   Buttons
   ========================================================= */

.teamtablely-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 22px;
	border-radius: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
	font-family: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.teamtablely-btn:focus-visible {
	outline: 3px solid #6366f1;
	outline-offset: 2px;
}

.teamtablely-btn:active {
	transform: scale(0.97);
}

.teamtablely-btn--primary {
	background: #6366f1;
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
	width: 100%;
	margin-top: 8px;
	padding: 14px 22px;
}

.teamtablely-btn--primary:hover {
	background: #4f46e5;
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.teamtablely-btn--primary:disabled {
	background: #a5b4fc;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

.teamtablely-btn--secondary {
	background: #f3f4f6;
	color: #374151;
	border: 2px solid #e5e7eb;
}

.teamtablely-btn--secondary:hover {
	background: #e5e7eb;
}

.teamtablely-btn--ghost {
	background: transparent;
	color: #6366f1;
	border: 2px solid #6366f1;
}

.teamtablely-btn--ghost:hover {
	background: #eef2ff;
}

.teamtablely-btn--full {
	width: 100%;
}

/* =========================================================
   Notices
   ========================================================= */

.teamtablely-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 10px;
	color: #b91c1c;
	padding: 12px 16px;
	font-size: 0.9rem;
	margin-bottom: 16px;
}

.teamtablely-info {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 10px;
	color: #1d4ed8;
	padding: 12px 16px;
	font-size: 0.9rem;
	margin-bottom: 16px;
}

.teamtablely-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	color: #166534;
	padding: 12px 16px;
	font-size: 0.9rem;
	margin-bottom: 16px;
}

.teamtablely-privacy-notice {
	text-align: center;
	font-size: 0.78rem;
	color: #9ca3af;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #f3f4f6;
}

/* =========================================================
   Result screen
   ========================================================= */

.teamtablely-result-section {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #f3f4f6;
}

.teamtablely-result-section:first-of-type {
	border-top: none;
}

.teamtablely-result__meta {
	text-align: center;
	color: #6b7280;
	font-size: 0.9rem;
	margin-bottom: 0 !important;
}

.teamtablely-link-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.teamtablely-link-row .teamtablely-link-input {
	flex: 1;
	min-width: 0;
}

.teamtablely-link-row .teamtablely-btn {
	flex-shrink: 0;
}

/* =========================================================
   QR Code
   ========================================================= */

.teamtablely-qr-container {
	text-align: center;
}

#teamtablely-qr-code {
	display: inline-block;
	padding: 16px;
	background: #ffffff;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	margin-bottom: 12px;
}

#teamtablely-qr-code canvas,
#teamtablely-qr-code img {
	display: block;
}

.teamtablely-qr-hint {
	font-size: 0.82rem;
	color: #6b7280;
	margin: 0 0 12px !important;
}

/* =========================================================
   Expiry Notice
   ========================================================= */

.teamtablely-expiry-notice {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	color: #92400e;
	padding: 12px 16px;
	font-size: 0.875rem;
	text-align: center;
	margin-top: 20px;
}

/* =========================================================
   Lookup Result Area
   ========================================================= */

.teamtablely-result-area {
	margin-top: 24px;
}

.teamtablely-table-result {
	text-align: center;
	padding: 24px 16px;
}

.teamtablely-table-result__greeting {
	font-size: 1.4rem;
	font-weight: 700;
	color: #111827;
	margin: 0 0 8px !important;
}

.teamtablely-table-result__table {
	font-size: 3rem;
	font-weight: 800;
	color: #6366f1;
	line-height: 1.1;
	margin: 0 !important;
}

.teamtablely-table-result__label {
	font-size: 0.85rem;
	color: #9ca3af;
	margin-top: 4px !important;
}

.teamtablely-multiple-results {
	margin-top: 12px;
}

.teamtablely-multiple-results__item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 8px;
}

.teamtablely-multiple-results__name {
	font-weight: 600;
	color: #111827;
}

.teamtablely-multiple-results__table {
	background: #6366f1;
	color: #fff;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.875rem;
}

/* =========================================================
   Example table in the upload form
   ========================================================= */

.teamtablely-example {
	margin-top: 24px;
}

.teamtablely-example summary {
	cursor: pointer;
	font-size: 0.875rem;
	color: #6366f1;
	font-weight: 500;
	user-select: none;
}

.teamtablely-example__content {
	margin-top: 12px;
}

.teamtablely-example__content > p {
	font-size: 0.875rem;
	color: #6b7280;
	margin: 0 0 8px !important;
}

.teamtablely-example__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	margin-bottom: 8px;
}

.teamtablely-example__table th,
.teamtablely-example__table td {
	text-align: left;
	padding: 6px 10px;
	border: 1px solid #e5e7eb;
}

.teamtablely-example__table th {
	background: #f3f4f6;
	font-weight: 600;
}

.teamtablely-example__note {
	font-size: 0.78rem;
	color: #9ca3af;
	margin: 0 !important;
}

/* =========================================================
   Loading spinner
   ========================================================= */

.teamtablely-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 3px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: teamtablely-spin 0.7s linear infinite;
	vertical-align: middle;
}

@keyframes teamtablely-spin {
	to { transform: rotate(360deg); }
}

/* =========================================================
   Utility
   ========================================================= */

[hidden] { display: none !important; }

/* =========================================================
   Setup warning notice
   ========================================================= */

.teamtablely-notice-warning {
	background: #fffbeb;
	border: 2px solid #f59e0b;
	border-radius: 10px;
	color: #78350f;
	padding: 14px 18px;
	font-size: 0.875rem;
	margin-bottom: 20px;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.teamtablely-notice-warning code {
	background: rgba(0,0,0,0.08);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.85em;
}

.teamtablely-notice-warning a {
	color: #92400e;
	font-weight: 600;
}

.teamtablely-result-help {
	font-size: 0.85rem;
	color: #6b7280;
	margin: 0 0 8px !important;
}

.teamtablely-result-test {
	font-size: 0.82rem;
	margin: 6px 0 0 !important;
}

.teamtablely-result-test a {
	color: #6366f1;
}
