/* TsuStaff - Main Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}



/* Layout Components */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

/* Navigation */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    min-height: 60px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ecf0f1;
}

.nav-menu {
    display: flex;
    gap: 0;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    padding: 20px 16px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: #34495e;
    color: white;
}

.nav-link.active {
    color: white;
    background: #34495e;
    border-bottom-color: #3498db;
}

.nav-user {
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: #2c3e50;
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.login-header p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.login-form {
    padding: 30px 20px;
}

.login-form h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.login-form p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.login-actions {
    margin-top: 20px;
    text-align: center;
}

.login-footer {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.resend-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 0.85rem;
}

.code-input {
    text-align: center;
    font-size: 1.5rem !important;
    letter-spacing: 0.5em;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

.btn-link {
    background: none;
    border: none;
    color: #3498db;
    text-decoration: underline;
    padding: 5px;
}

.btn-link:hover {
    color: #2980b9;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #363;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.page-header h2 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.page-header p {
    color: #666;
    margin: 0;
}

/* Info Display */
.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 500;
    color: #555;
    min-width: 120px;
}

.info-item span {
    color: #333;
    text-align: right;
}

/* Stats */
.stat-item {
    text-align: center;
    margin-bottom: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    line-height: 1;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

.department-stats {
    margin-top: 20px;
}

.department-stats h4 {
    margin-bottom: 10px;
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dept-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dept-item:last-child {
    border-bottom: none;
}

.dept-name {
    color: #333;
}

.dept-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 0.8rem;
    color: #666;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 20px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 10px 20px;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .nav-user {
        margin-top: 10px;
        order: -1;
    }
    
    .main-container {
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-item span {
        text-align: left;
    }
    
    .login-container {
        margin: 10px;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .login-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-link {
        text-align: center;
        padding: 8px;
    }
    
    .main-container {
        padding: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 6px;
    }
    
    .activity-content {
        width: 100%;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.hidden { display: none; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Staff Directory Styles */
.search-form {
    margin: 0;
}

.search-filters {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.search-input,
.filter-select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.search-input {
    min-width: 250px;
}

.filter-select {
    min-width: 180px;
}

.results-summary {
    margin: 20px 0 10px 0;
    color: #666;
    font-size: 14px;
}

.table-responsive {
    overflow-x: auto;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.staff-table th,
.staff-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.staff-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

.staff-table th a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 4px 0;
}

.staff-table th a:hover {
    color: #3498db;
}

.staff-table tbody tr:hover {
    background: #f8f9fa;
}

.name-cell {
    min-width: 180px;
}

.name-cell strong {
    display: block;
    margin-bottom: 2px;
}

.current-user {
    color: #3498db;
    font-size: 12px;
    font-weight: normal;
}

.phone-link {
    color: #3498db;
    text-decoration: none;
}

.phone-link:hover {
    text-decoration: underline;
}

.emergency-cell {
    min-width: 200px;
}

.emergency-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-name {
    font-weight: 500;
    color: #333;
}

.contact-phone {
    font-size: 13px;
    color: #666;
}

.not-specified {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Mobile Responsive for Staff Directory */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .staff-table {
        font-size: 13px;
    }
    
    .staff-table th,
    .staff-table td {
        padding: 8px 6px;
    }
    
    .name-cell {
        min-width: 120px;
    }
    
    .emergency-cell {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    /* Stack table info vertically on very small screens */
    .staff-table,
    .staff-table thead,
    .staff-table tbody,
    .staff-table th,
    .staff-table td,
    .staff-table tr {
        display: block;
    }
    
    .staff-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .staff-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 6px;
        background: white;
    }
    
    .staff-table td {
        border: none;
        padding: 5px 0;
        position: relative;
        padding-left: 25%;
    }
    
    .staff-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 20%;
        font-weight: 600;
        color: #555;
    }
}

/* Enrollment Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Mobile responsive form */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
.btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .login-actions {
        display: none;
    }
    
    .main-container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


/* Admin Controls */
.admin-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.staff-name-link {
    color: #3498db;
    text-decoration: none;
}

.staff-name-link:hover {
    text-decoration: underline;
}

.staff-name-link strong {
    color: inherit;
}

.admin-badge {
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: 2px solid #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

/* Department Collapsible Styles */
.dept-item {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
}

.dept-item:last-child {
    border-bottom: none;
}

.dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.dept-header:hover {
    background: #e9ecef;
}

.dept-header:active {
    background: #dee2e6;
}

.dept-toggle {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

.dept-details {
    background: #fff;
    border-left: 3px solid #e3f2fd;
    margin-top: 5px;
    border-radius: 0 4px 4px 0;
}

.dept-staff-list {
    padding: 10px 15px;
    max-height: 200px;
    overflow-y: auto;
}

.staff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.staff-item:last-child {
    border-bottom: none;
}

.staff-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.staff-phone {
    color: #666;
    font-size: 13px;
    font-family: monospace;
}

/* Mobile optimized touch targets */
@media (max-width: 768px) {
    .dept-header {
        padding: 15px;
        font-size: 16px;
    }
    
    .dept-toggle {
        font-size: 14px;
    }
    
    .staff-item {
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .staff-name {
        font-size: 15px;
    }
    
    .staff-phone {
        font-size: 14px;
    }
}


.dept-lead-indicator {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 3px;
    font-size: 14px;
}

.staff-name-link {
    color: #3498db;
    text-decoration: none;
}

.staff-name-link:hover {
    text-decoration: underline;
}

.dept-lead-indicator {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 3px;
    font-size: 14px;
}


/* Department staff list styling - final version */
.staff-item {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.staff-item:last-child {
    border-bottom: none;
}

.staff-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.staff-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.staff-email {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
}

.staff-email:hover {
    text-decoration: underline;
}

.staff-phone {
    color: #666;
    font-size: 13px;
    font-family: monospace;
}

.staff-phone {
    color: #666;
    font-size: 13px;
    font-family: monospace;
    white-space: nowrap;
}