/* Membership System Styles */

/* Common Styles */
.membership-system {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Form Styles */
.membership-form .form-group {
    margin-bottom: 1.5rem;
}

.membership-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.membership-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    min-height: 44px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.membership-form .form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    color: white;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    color: white;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Table Styles */
.membership-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.membership-table th,
.membership-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.membership-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.membership-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    color: #065f46;
    background-color: #d1fae5;
    border-color: #a7f3d0;
}

.alert-danger {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.alert-info {
    color: #1e40af;
    background-color: #dbeafe;
    border-color: #93c5fd;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.membership-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.membership-modal-content {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.membership-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.membership-modal-close:hover {
    color: #374151;
}

/* Search Form */
.membership-search-form {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.membership-search-form .form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.membership-search-form .form-group {
    flex: 1;
    min-width: 200px;
}

/* Navigation */
.membership-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.membership-nav .nav-btn {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.membership-nav .nav-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.membership-nav .nav-btn.active {
    background: #3b82f6;
    color: white;
}

/* Dashboard Header */
.membership-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.membership-dashboard-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

/* Profile Card */
.membership-profile-card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.membership-profile-field {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.membership-profile-field:last-child {
    border-bottom: none;
}

.membership-profile-field .label {
    flex: 0 0 200px;
    font-weight: 600;
    color: #6b7280;
}

.membership-profile-field .value {
    flex: 1;
    color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
    .membership-search-form .form-row {
        flex-direction: column;
    }
    
    .membership-search-form .form-group {
        min-width: auto;
    }
    
    .membership-table {
        font-size: 0.875rem;
    }
    
    .membership-table th,
    .membership-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .membership-nav {
        flex-direction: column;
    }
    
    .membership-profile-field {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .membership-profile-field .label {
        flex: none;
    }
    
    .membership-modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .membership-dashboard-header {
        padding: 1.5rem 1rem;
    }
    
    .membership-dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .membership-table th,
    .membership-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
}

/* Print Styles */
@media print {
    .no-print,
    .btn,
    .membership-nav,
    .membership-search-form {
        display: none !important;
    }
    
    .membership-table {
        border: 1px solid #000;
    }
    
    .membership-table th,
    .membership-table td {
        border: 1px solid #000;
        padding: 0.5rem;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }


/* Hide DataTables default search filter */
div#example_filter {
	display: none;
}

/* Main Dashboard Container */
.dashboard-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
}

/* Page Header */
.page-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 30px;
	border-radius: 10px;
	margin-bottom: 30px;
	text-align: center;
	margin-top: 100px;
}

.page-header h1 {
	margin: 0 0 10px 0;
	font-size: 2rem;
	font-weight: 700;
}

/* Navigation Bar */
.navigation-bar {
	background: #f8f9fa;
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 30px;
}

.nav-links {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.nav-link {
	background: #007cba;
	color: white;
	padding: 8px 16px;
	text-decoration: none;
	border-radius: 5px;
	font-size: 0.9rem;
	transition: background 0.3s;
}

.nav-link:hover {
	background: #005a87;
	color: white;
}

.nav-link.active {
	background: #28a745;
}

/* Search Container */
.search-container {
	background: white;
	padding: 30px;
	border-radius: 10px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	margin-bottom: 30px;
}

.search-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 15px;
	margin-bottom: 20px;
}

/* Form Elements */
.form-group {
	margin-bottom: 15px;
}

.form-label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #374151;
	font-size: 0.9rem;
}

.form-control {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 15px;
	line-height: 1.5;
	min-height: 44px;
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Styles */
.btn {
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease-in-out;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btn-primary {
	background-color: #3b82f6;
	color: white;
}

.btn-primary:hover {
	background-color: #2563eb;
	color: white;
}

.btn-success {
	background-color: #10b981;
	color: white;
}

.btn-success:hover {
	background-color: #059669;
	color: white;
}

.btn-warning {
	background-color: #f59e0b;
	color: white;
}

.btn-warning:hover {
	background-color: #d97706;
	color: white;
}

.btn-danger {
	background-color: #ef4444;
	color: white;
}

.btn-danger:hover {
	background-color: #dc2626;
	color: white;
}

.btn-secondary {
	background-color: #6b7280;
	color: white;
}

.btn-secondary:hover {
	background-color: #4b5563;
	color: white;
}

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

/* Table Styles */
.table-container {
	background: white;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table {
	margin-bottom: 0;
}

.table thead th {
	background-color: #f8fafc;
	border-bottom: 2px solid #e2e8f0;
	font-weight: 600;
	color: #374151;
	vertical-align: middle;
	text-align: center;
	padding: 12px;
	font-size: 0.9rem;
}

.table tbody td {
	vertical-align: middle;
	padding: 12px;
	border-bottom: 1px solid #e2e8f0;
	text-align: center;
}

.table tbody tr:hover {
	background-color: #f8fafc;
}

.btn-group {
	display: flex;
	gap: 5px;
	justify-content: center;
}

.action-buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	margin-bottom: 20px;
}

/* Legacy Select Styles */
.select-selected {
	color: #495057 !important;
}

select.select-selected.form-control {
	border: 1px solid #ced4da !important;
}

/* ===================================================
   ADD MEMBER FORM STYLES
   =================================================== */

.add-member-container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
}

.form-container {
	background: white;
	padding: 30px;
	border-radius: 10px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

.form-group.full-width {
	grid-column: 1 / -1;
}

.required::after {
	content: " *";
	color: #ef4444;
}

.form-control.error {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Ensure consistent form field heights for add and edit member forms */
.add-member-container .form-control,
.edit-member-container .form-control {
	padding: 12px 15px;
	font-size: 15px;
	line-height: 1.5;
	min-height: 44px;
	box-sizing: border-box;
}

.add-member-container input[type="text"],
.add-member-container input[type="email"], 
.add-member-container input[type="number"],
.add-member-container select,
.add-member-container textarea,
.edit-member-container input[type="text"],
.edit-member-container input[type="email"], 
.edit-member-container input[type="number"],
.edit-member-container select,
.edit-member-container textarea {
	padding: 12px 15px !important;
	font-size: 15px !important;
	line-height: 1.5 !important;
	min-height: 44px !important;
	box-sizing: border-box !important;
}

/* Textarea specific height */
.add-member-container textarea,
.edit-member-container textarea {
	min-height: 80px !important;
	resize: vertical;
}

/* Form labels for consistent styling */
.add-member-container .form-label,
.edit-member-container .form-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #374151;
	font-size: 15px;
}

/* Help text styling */
.add-member-container .help-text,
.edit-member-container .help-text {
	font-size: 13px;
	color: #6b7280;
	margin-top: 5px;
	line-height: 1.4;
}

/* Form group spacing */
.add-member-container .form-group,
.edit-member-container .form-group {
	margin-bottom: 20px;
}

/* Ensure consistent button heights */
.add-member-container .btn,
.edit-member-container .btn {
	padding: 12px 24px;
	font-size: 15px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.error-message {
	color: #ef4444;
	font-size: 0.875rem;
	margin-top: 5px;
	display: block;
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.alert {
	padding: 16px;
	border-radius: 6px;
	margin-bottom: 20px;
	border: 1px solid transparent;
}

.alert-success {
	color: #065f46;
	background-color: #d1fae5;
	border-color: #a7f3d0;
}

.alert-danger {
	color: #991b1b;
	background-color: #fee2e2;
	border-color: #fca5a5;
}

.loading-spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 2px solid #f3f4f6;
	border-top: 2px solid #3b82f6;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-right: 8px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.form-buttons {
	display: flex;
	gap: 10px;
	margin-top: 30px;
	justify-content: flex-end;
}

.help-text {
	font-size: 0.875rem;
	color: #6b7280;
	margin-top: 4px;
}

/* ===================================================
   PRINT STYLES
   =================================================== */

@media print {
	@page {
		size: 297mm 210mm; /* landscape */
		margin: 25mm;
		margin-right: 45mm;
	}
}

/* ===================================================
   RESPONSIVE STYLES
   =================================================== */

@media (max-width: 768px) {
	.dashboard-container {
		margin: 10px;
		padding: 10px;
	}
	
	.add-member-container {
		margin: 10px;
		padding: 10px;
	}
	
	.search-grid {
		grid-template-columns: 1fr;
	}
	
	.form-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}
	
	.search-container {
		padding: 20px;
	}
	
	.form-container {
		padding: 20px;
	}
	
	.nav-links {
		flex-direction: column;
	}
	
	.action-buttons {
		flex-direction: column;
	}
	
	.form-buttons {
		flex-direction: column;
	}
	
	.btn {
		width: 100%;
		margin-bottom: 5px;
	}

	.table-container {
		overflow-x: auto;
	}
}