/* General Body and Container Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5; /* Default light grey background */
    color: #333;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px; /* Default max width for main content */
    margin: 0 auto;
    padding: 1rem;
    flex-grow: 1; /* Allows container to grow and fill space */
    display: flex;
    flex-direction: column;
}

/* Section Titles */
.section-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* Card Styles */
.card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Primary Button Styles (General) */
.button-primary {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.button-primary:hover {
    background-color: #2980b9;
}

/* Secondary Button Styles (General) */
.button-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
    border: 1px solid #d1d5db;
}
.button-secondary:hover {
    background-color: #e5e7eb;
}

/* Portal Header Styles (Common) */
.portal-header {
    background-color: #2c3e50; /* Dark blue */
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Portal Sidebar Styles */
.portal-sidebar {
    background-color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Specific colors for portal differentiation (used as classes on body/container) */
.portal-staff-theme { background-color: #e6f2ff; } /* Light Blue */
.portal-staff { background-color: #e6f2ff; } /* Added from staff_landing */
.portal-student-theme { background-color: #e6ffe6; } /* Light Green */
.portal-parent-theme { background-color: #fff2e6; } /* Light Orange */
.portal-visitor-theme { background-color: #f5f5f5; } /* Light Grey */

/* --- QR Scanner Specific Styles --- */
.qr-scanner-body {
    background-color: #e0f2f7; /* Light blue/teal for scanner theme */
}

.qr-scanner-container {
    max-width: 768px; /* Max width for tablet/mobile focus */
    margin: 0 auto;
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#qr-reader {
    width: 100%;
    max-width: 400px; /* Limit scanner area width */
    margin: 0 auto;
    border: 2px solid #3498db;
    border-radius: 0.5rem;
    overflow: hidden; /* Ensure video fits */
}
#qr-reader video {
    width: 100% !important;
    height: auto !important;
}

/* Message Box Styles (General Alerts) */
.message-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
}
.message-box.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message-box.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message-box.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Manual Search Section Styles */
.manual-search-section {
    display: none; /* Hidden by default */
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Guard Landing Specific Styles */
.header-guard {
    background-color: #2c3e50; /* Dark blue */
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    text-align: center;
}
.action-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 1.5rem;
    flex-grow: 1;
}
@media (min-width: 640px) { /* Small screens (sm) and up */
    .action-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns for tablet/larger */
    }
}
.action-card { /* General action card for dashboards */
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px; /* Ensure cards have a minimum height */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.action-card i {
    font-size: 3rem; /* Large icons */
    color: #3498db; /* Blue icon color */
    margin-bottom: 0.75rem;
}
.action-card span {
    font-weight: 600;
    color: #2c3e50;
}
.footer-guard {
    background-color: #2c3e50;
    color: white;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    margin-top: 1.5rem;
}

/* Duty Landing Specific Styles */
.header-duty {
    background-color: #1a5276; /* Darker blue */
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    text-align: center;
}
.footer-duty {
    background-color: #1a5276;
    color: white;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    margin-top: 1.5rem;
}
.action-card i.duty-icon { /* Specific icon size for duty cards if needed */
    font-size: 2.5rem;
}

/* Role Selection Landing Specific Styles */
.role-selection-body { /* New class for the body of role selection page */
    background-color: #f0f2f5; /* Same as default body, but explicitly for clarity */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}
.role-selection-container { /* New class for the container of role selection page */
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
}
.button-role {
    background-color: #3498db;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    width: 100%; /* Make buttons full width */
}
.button-role:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}
.button-role i {
    font-size: 1.5rem;
}
.flash-message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.flash-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Base body background for guard theme */
body.guard-theme-bg {
    background-color: #e0f2f7; /* Light blue/teal for guard theme */
}

/* Base body background for duty theme */
body.duty-theme-bg {
    background-color: #e6f7ff; /* Light blue for duty theme */
}

/* QR Generator Form/Display specific styles */
.qr-form-container, .qr-display-container {
    max-width: 500px;
    width: 100%;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.qr-generator-body { /* Apply this to the body of qr_generator_form.php and qr_display.php */
    background-color: #f8f9fa; /* Lighter background for a utility page */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
#qrcode {
    width: 256px; /* Standard QR code size */
    height: 256px;
    margin: 0 auto 1.5rem auto;
    border: 1px solid #e2e8f0; /* Light border around QR */
    padding: 10px; /* Padding inside the QR border */
    background-color: white;
}

/* SAdmin Dashboard Specific Styles */
.portal-sadmin-theme { background-color: #f7e6ff; } /* Light Purple */
.data-table-section {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.data-table-section h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* User Profile Specific Styles */
.user-profile-body {
    background-color: #f0f2f5; /* Consistent with general body */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.user-profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    flex-grow: 1;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #4a5568;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* --- Styles from SAdmin Management Views (Roles, Modules, Permissions, Users) --- */

/* General button styles for CRUD actions */
.btn-primary { /* Overrides the .button-primary above for specific contexts, if needed. */
    background-color: #4f46e5; /* Indigo */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-primary:hover {
    background-color: #4338ca; /* Darker Indigo */
}
.btn-danger {
    background-color: #ef4444; /* Red */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.btn-danger:hover {
    background-color: #dc2626; /* Darker Red */
}
.btn-edit {
    background-color: #3b82f6; /* Blue */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.btn-edit:hover {
    background-color: #2563eb; /* Darker Blue */
}

/* Alert messages (similar to flash-message but for JS alerts) */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px; /* Default for roles/modules, adjusted for users below */
    position: relative;
}
/* Specific max-width for User Management Modal */
.modal-content.user-modal {
    max-width: 600px;
}
.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

/* Table styles (for all management pages) */
table.min-w-full {
    min-width: 100%;
}
table th, table td {
    padding: 0.75rem 1rem; /* Adjusted padding for table cells */
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
table thead tr {
    background-color: #f9fafb; /* Light background for table header */
}
table th {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
table tbody tr:last-child {
    border-bottom: none;
}
table tbody tr:hover {
    background-color: #f3f4f6; /* Hover effect for table rows */
}

/* Form input styles (general for management pages) */
.form-input-field { /* Use this class for common input/select styling */
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #ffffff;
}
.form-input-field:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Role Permissions Specific Styles */
.permission-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #f9fafb;
}
.permission-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
/* Sticky header for permission matrix */
.permission-matrix-table th.sticky-left {
    position: sticky;
    left: 0;
    background-color: #f9fafb; /* Match header background */
    z-index: 10;
}
.permission-matrix-table td.sticky-left {
    position: sticky;
    left: 0;
    background-color: #ffffff; /* Match row background */
    z-index: 9;
}


/* User Assigned Roles Specific Styles */
.role-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e0e7ff; /* Light blue for tags */
    color: #4338ca; /* Darker blue text */
    padding: 0.25rem 0.75rem;
    border-radius: 9999px; /* Full rounded */
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.role-tag button {
    margin-left: 0.5rem;
    background: none;
    border: none;
    color: #4338ca;
    font-size: 0.875rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.role-tag button:hover {
    color: #1e293b;
}

/* General form element styling for consistency */
label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.25rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #ffffff;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* In your assets/css/ishworld_styles.css file */

/* Styles for clickable cards */
/* In your assets/css/ishworld_styles.css file */

/* Card container styles for active links */
.portal-card-container {
    background-color: white;
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1.5rem; /* p-6 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); /* shadow-sm */
}

.portal-card-container:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* shadow-lg */
    transform: translateY(-2px);
}

.portal-card-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: #1f2937; /* text-gray-800 */
}

.portal-card-description {
    color: #4b5563; /* text-gray-600 */
    margin-top: 0.25rem; /* mt-1 */
    flex-grow: 1;
    padding-bottom: 1.5rem; /* pb-6 to push button down */
}

.portal-card-button {
    color: white;
    font-weight: 700; /* font-bold */
    padding: 0.5rem 1rem; /* py-2 px-4 */
    border-radius: 0.375rem; /* rounded */
    text-align: center;
    transition: background-color 0.2s;
    display: block;
    width: 100%;
}


/* Card container styles for disabled links */
.portal-card-container-disabled {
    background-color: #f9fafb; /* bg-gray-50 */
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1.5rem; /* p-6 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0.7;
}

.portal-card-button-disabled {
    background-color: #d1d5db; /* bg-gray-300 */
    color: #6b7280; /* text-gray-500 */
    font-weight: 700; /* font-bold */
    padding: 0.5rem 1rem; /* py-2 px-4 */
    border-radius: 0.375rem; /* rounded */
    text-align: center;
    cursor: not-allowed;
    display: block;
    width: 100%;
}