/**
 * Classes Overview Styles
 *
 * Minimal custom styles - relies on WordPress theme for colors, fonts, buttons
 *
 * @package DanceSchoolManager
 * @since 1.1.0
 */

/* ==================== */
/* Compact My Account Buttons */
/* ==================== */

.dsm-classes-overview .button,
.dsm-ticket-details .button {
	padding: 0.3em 0.6em !important;
	font-size: 0.85em !important;
	line-height: 1.3 !important;
}

.dsm-class-actions .button {
	padding: 0.25em 0.5em !important;
	font-size: 0.8em !important;
	line-height: 1.3 !important;
}

/* ==================== */
/* Classes Overview */
/* ==================== */

.dsm-classes-overview {
	margin: 1.5em 0;
}

.dsm-classes-overview-header {
	margin-bottom: 1.5em;
	padding-bottom: 1em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1em;
}

.dsm-classes-overview-header h2 {
	margin: 0;
}

/* Events List */
.dsm-events-list {
	display: flex;
	flex-direction: column;
	gap: 1.5em;
}

.dsm-event-item {
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0.02);
}

.dsm-event-header {
	margin-bottom: 0.75em;
}

.dsm-event-title {
	margin: 0 0 0.5em 0;
}

/* Collapsible event toggle */
.dsm-event-toggle {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.dsm-event-toggle:hover {
	background: none;
	opacity: 0.7;
}

.toggle-indicator {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 10px 6px 0 6px;
	border-color: currentColor transparent transparent transparent;
	display: inline-block;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.dsm-event-toggle[aria-expanded="false"] .toggle-indicator {
	transform: rotate(-90deg);
}

/* Collapsible content */
.dsm-event-content {
	display: block;
}

.dsm-event-item .dsm-event-toggle[aria-expanded="false"] ~ .dsm-event-content {
	display: none;
}

.dsm-event-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	flex-wrap: wrap;
}

/* Classes List */
.dsm-classes-list {
	display: flex;
	flex-direction: column;
	gap: 1em;
	padding-left: 1.5em;
}

.dsm-class-item {
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0.01);
}

.dsm-class-item.dsm-invitation-received {
	border-style: dashed;
	background-color: rgba(0, 0, 0, 0.03);
}

.dsm-invitation-meta {
	margin: 0.3em 0;
	font-size: 0.9em;
	opacity: 0.85;
}

.dsm-class-info {
	flex: 1;
	min-width: 250px;
}

.dsm-class-title {
	margin: 0 0 0.5em 0;
	font-size: 1.1em;
}

.dsm-class-dates,
.dsm-partner-status {
	margin: 0.25em 0;
	opacity: 0.8;
}

/* Action buttons row layout */
.dsm-class-actions {
	display: flex;
	gap: 0.5em;
	flex-wrap: wrap;
	align-items: flex-start;
	margin-top: 1em;
}

.dsm-class-actions .button:hover {
	opacity: 0.8;
}

/* Inline table styling */
.dsm-inline-table {
	display: inline-block;
}

.dsm-inline-row {
	margin: 0.25em 0;
}

.dsm-inline-label {
	font-weight: 600;
	margin-right: 0.5em;
}

.dsm-inline-value {
	margin-right: 1em;
}

/* ==================== */
/* Ticket Details */
/* ==================== */

.dsm-ticket-details {
	margin: 1.5em 0;
}

.dsm-ticket-header {
	margin-bottom: 1.5em;
	padding-bottom: 1em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dsm-ticket-header h2 {
	margin: 0 0 0.5em 0;
}

.dsm-back-link {
	margin-top: 0.5em;
}

/* Ticket sections */
.dsm-ticket-section {
	margin-bottom: 1.5em;
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0.02);
}

.dsm-ticket-section.dsm-qr-section {
	padding: 1.5em;
}

.dsm-qr-section .dsm-qr-display {
	display: inline-block;
}

.dsm-ticket-section h3 {
	margin: 0 0 0.75em 0;
	padding-bottom: 0.5em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dsm-session-info p,
.dsm-single-session p {
	margin: 0.5em 0;
}

.dsm-session-details {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-top: 1em;
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0.01);
}

.dsm-description-content {
	line-height: 1.6;
}

.dsm-description-content p:first-child {
	margin-top: 0;
}

.dsm-description-content p:last-child {
	margin-bottom: 0;
}

/* ==================== */
/* Sessions Table */
/* ==================== */

.dsm-sessions-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1em;
}

.dsm-sessions-table th,
.dsm-sessions-table td {
	padding: 0.75em;
	text-align: left;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dsm-sessions-table th {
	font-weight: 600;
	background-color: rgba(0, 0, 0, 0.03);
}

.dsm-sessions-table tbody tr:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.dsm-sessions-table .session-number {
	width: 50px;
	text-align: center;
	font-weight: 600;
}

.dsm-sessions-table .session-status {
	text-align: center;
}

@media (max-width: 768px) {
	.dsm-sessions-table {
		font-size: 0.9em;
	}
	
	.dsm-sessions-table th,
	.dsm-sessions-table td {
		padding: 0.5em;
	}
}

/* ==================== */
/* Date/Time Blocks */
/* ==================== */

.dsm-datetime-block {
	display: block;
	margin: 0.25em 0;
}

.dsm-datetime-block .dashicons {
	margin-right: 0.5em;
}

.dsm-date-block,
.dsm-time-block {
	display: inline-block;
}

/* ==================== */
/* Icons */
/* ==================== */

.dsm-classes-overview .dashicons,
.dsm-ticket-details .dashicons {
	vertical-align: middle;
	margin-right: 0.25em;
	width: 1.2em;
	height: 1.2em;
	font-size: 1.2em;
}

.dsm-icon-text {
	align-items: center;
	gap: 0.3em;
}

/* ==================== */
/* Status Badges */
/* ==================== */

.dsm-checkin-status {
	padding: 0.2em 0.65em;
	border-radius: 999px;
	border: 1px solid currentColor;
	font-size: 0.85em;
	font-weight: 600;
}

.dsm-checkin-status.present {
	background-color: #d4edda;
	color: #155724;
}

.dsm-checkin-status.absent {
	background-color: #f8d7da;
	color: #721c24;
}

/* ==================== */
/* QR Code Modal */
/* ==================== */

.dsm-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: none;
}

.dsm-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	cursor: pointer;
}

.dsm-modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 4px;
	max-width: 500px;
	width: 90%;
	max-height: 90vh;
	overflow: auto;
	box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
	padding-top: 2.5em;
}

.dsm-modal-close {
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25em;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
	transition: color 0.2s;
	z-index: 1;
}

.dsm-modal-close .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.dsm-modal-close:hover {
	color: #000;
}

.dsm-modal-body {
	padding: 1.5em;
}

.dsm-qr-loading {
	text-align: center;
	padding: 3em 1em;
	font-size: 1.1em;
	color: #666;
}

.dsm-qr-container {
	text-align: center;
	padding: 1em;
}

.dsm-qr-container img {
	max-width: 100%;
	height: auto;
	display: inline-block;
}

/* ==================== */
/* Responsive */
/* ==================== */

@media (max-width: 768px) {
	.dsm-class-item {
		flex-direction: column;
	}
	
	.dsm-class-actions {
		width: 100%;
	}
	
	.dsm-ticket-header-flex {
		flex-direction: column;
	}
	
	.dsm-ticket-header-flex .dsm-event-info {
		min-width: 100%;
	}
	
	.dsm-qr-display {
		width: 100%;
	}
}
