/* 
 * Temp-Account Main Stylesheet
 * ระบบจัดการบัญชีอินเทอร์เน็ตแบบชั่วคราว
 */

/* ========================================
   CSS Variables (Theme)
   ======================================== */
:root {
	--sidebar-bg: #1e3a5f;
	--sidebar-hover: #2a4a6f;
	--primary: #ff6b35;
	--primary-hover: #e55a28;
	--success: #28a745;
	--info: #3498db;
	--danger: #dc3545;
	--warning: #ffc107;
	--bg-light: #f5f7fa;
	--card-bg: #ffffff;
	--text-dark: #333333;
	--text-light: #ffffff;
	--text-muted: #6c757d;
	--border-color: #e0e0e0;
}

/* ========================================
   Reset & Base
   ======================================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Sarabun', Arial, sans-serif;
	font-size: 14px;
	color: var(--text-dark);
	background: var(--bg-light);
	min-height: 100vh;
	display: flex;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
	width: 260px;
	background: var(--sidebar-bg);
	min-height: 100vh;
	position: fixed;
	left: 0;
	top: 0;
	display: flex;
	flex-direction: column;
	z-index: 100;
}

.sidebar-header {
	padding: 20px;
	text-align: center;
	border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
	color: var(--text-light);
	font-size: 20px;
	font-weight: 700;
	text-decoration: none;
}

.sidebar-logo span {
	color: var(--primary);
}

.sidebar-menu {
	flex: 1;
	padding: 15px 0;
	overflow-y: auto;
}

.menu-section {
	margin-bottom: 10px;
}

.menu-section-title {
	color: rgba(255,255,255,0.5);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 10px 20px;
	margin-bottom: 5px;
}

.menu-item {
	display: flex;
	align-items: center;
	padding: 12px 20px;
	color: rgba(255,255,255,0.8);
	text-decoration: none;
	transition: all 0.2s;
	border-left: 3px solid transparent;
}

.menu-item:hover {
	background: var(--sidebar-hover);
	color: var(--text-light);
}

.menu-item.active {
	background: var(--primary);
	color: var(--text-light);
	border-left-color: var(--text-light);
}

.menu-icon {
	width: 20px;
	margin-right: 12px;
	text-align: center;
}

/* ========================================
   User Section
   ======================================== */
.sidebar-user {
	padding: 15px 20px;
	border-top: 1px solid rgba(255,255,255,0.1);
	background: rgba(0,0,0,0.1);
}

.user-info {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}

.user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--primary);
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	margin-right: 10px;
}

.user-details {
	flex: 1;
}

.user-name {
	color: var(--text-light);
	font-weight: 500;
	font-size: 13px;
}

.user-role {
	font-size: 11px;
	color: var(--primary);
}

.btn-logout {
	display: block;
	width: 100%;
	padding: 10px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 6px;
	text-align: center;
	text-decoration: none;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}

.btn-logout:hover {
	background: var(--primary-hover);
}

/* ========================================
   Login Box in Sidebar
   ======================================== */
.sidebar-login {
	padding: 20px;
	border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-login h4 {
	color: var(--text-light);
	margin-bottom: 15px;
	font-size: 14px;
	text-align: center;
}

.sidebar-login input[type="text"],
.sidebar-login input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	margin-bottom: 10px;
	border: none;
	border-radius: 6px;
	background: rgba(255,255,255,0.1);
	color: var(--text-light);
}

.sidebar-login input::placeholder {
	color: rgba(255,255,255,0.5);
}

.sidebar-login input[type="submit"] {
	width: 100%;
	padding: 10px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
}

.sidebar-login .errors {
	background: rgba(220,53,69,0.2);
	color: #ff6b6b;
	padding: 10px;
	border-radius: 6px;
	margin-bottom: 10px;
	list-style: none;
	font-size: 12px;
}

/* ========================================
   Main Content
   ======================================== */
.main-wrapper {
	flex: 1;
	margin-left: 260px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.header {
	background: var(--card-bg);
	padding: 15px 25px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.header-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--sidebar-bg);
}

.header-subtitle {
	font-size: 12px;
	color: var(--text-muted);
}

/* ========================================
   Flash Messages
   ======================================== */
.flash-container {
	padding: 15px 25px 0;
}

.flash {
	padding: 12px 20px;
	border-radius: 8px;
	font-weight: 500;
	margin-bottom: 10px;
}

.flash.success {
	background: #d4edda;
	color: #155724;
	border-left: 4px solid var(--success);
}

.flash.error {
	background: #f8d7da;
	color: #721c24;
	border-left: 4px solid var(--danger);
}

/* ========================================
   Content Area
   ======================================== */
.content {
	flex: 1;
	padding: 25px;
}

/* ========================================
   Cards
   ======================================== */
.card {
	background: var(--card-bg);
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	margin-bottom: 20px;
}

.card-header {
	padding: 15px 20px;
	background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2a4a6f 100%);
	color: white;
	font-weight: 600;
	font-size: 16px;
	display: flex;
	align-items: center;
	border-radius: 10px 10px 0 0;
}

.card-header-icon {
	margin-right: 10px;
	color: white;
}

.card-body {
	padding: 20px;
}

/* ========================================
   Section Header
   ======================================== */
.section-header {
	background: #fff5f0;
	color: var(--primary);
	padding: 10px 15px;
	border-radius: 6px;
	border-left: 4px solid var(--primary);
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 15px;
}

/* ========================================
   Stat Cards
   ======================================== */
.stat-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 25px;
}

.stat-card {
	background: var(--card-bg);
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	display: flex;
	align-items: center;
}

.stat-icon {
	width: 50px;
	height: 50px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	margin-right: 15px;
}

.stat-icon.orange { background: rgba(255,107,53,0.15); color: var(--primary); }
.stat-icon.green { background: rgba(40,167,69,0.15); color: var(--success); }
.stat-icon.blue { background: rgba(52,152,219,0.15); color: var(--info); }

.stat-content h3 {
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 2px;
}

.stat-content p {
	font-size: 13px;
	color: var(--text-muted);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 500;
	font-size: 13px;
	cursor: pointer;
	border: none;
	transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #218838; }

.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #2980b9; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c82333; }

.btn-warning { background: #ffc107; color: #212529; }
.btn-warning:hover { background: #e0a800; }

.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ========================================
   Data Tables
   ======================================== */
.data-table {
	width: 100%;
	border-collapse: collapse;
}

.data-table th {
	background: var(--sidebar-bg);
	color: white;
	padding: 12px 15px;
	text-align: left;
	font-weight: 500;
}

.data-table td {
	padding: 12px 15px;
	border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
	background: #f8f9fa;
}

/* ========================================
   Badges
   ======================================== */
.badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
}

.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: #333; }
.badge-danger { background: var(--danger); color: white; }
.badge-info { background: var(--info); color: white; }

/* ========================================
   Form Errors
   ======================================== */
.form-errors {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 20px;
}

.form-errors ul {
	margin: 0;
	padding-left: 20px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
	background: var(--card-bg);
	padding: 15px 25px;
	text-align: center;
	font-size: 12px;
	color: var(--text-muted);
	border-top: 1px solid var(--border-color);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
	.sidebar {
		transform: translateX(-100%);
	}
	
	.main-wrapper {
		margin-left: 0;
	}
}

/* ========================================
   Flatpickr Theme Customization
   ======================================== */
.flatpickr-calendar {
	font-family: 'Sarabun', Arial, sans-serif;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	border: none;
}

.flatpickr-months {
	background: var(--sidebar-bg);
	border-radius: 10px 10px 0 0;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month {
	color: var(--text-light);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
	fill: var(--text-light);
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
	fill: var(--primary);
}

.flatpickr-weekdays {
	background: var(--sidebar-bg);
}

span.flatpickr-weekday {
	color: rgba(255,255,255,0.7);
	font-weight: 500;
}

.flatpickr-day {
	border-radius: 6px;
	color: var(--text-dark);
}

.flatpickr-day:hover {
	background: var(--bg-light);
	border-color: var(--primary);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
	background: var(--primary);
	border-color: var(--primary);
	color: white;
}

.flatpickr-day.today {
	border-color: var(--info);
}

.flatpickr-day.today:hover {
	background: var(--info);
	color: white;
}

.flatpickr-time {
	border-top: 1px solid var(--border-color);
}

.flatpickr-time input {
	font-family: 'Sarabun', Arial, sans-serif;
	font-weight: 500;
}

.flatpickr-time .numInputWrapper:hover {
	background: var(--bg-light);
}
