/* Global CSS for InMotion Physiotherapy Timecard System */
/* Ensures consistent styling across all pages and fixes layout issues */

/* Tab functionality CSS - Critical for tabbed interfaces */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-button {
    border-color: transparent;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: #374151;
    border-color: #D1D5DB;
}

.tab-button.active {
    color: #3B82F6;
    border-color: #3B82F6;
    background-color: #F9FAFB;
}

/* Card styling - Consistent across all pages */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Button styles - Consistent across all pages */
.btn-primary {
    background-color: #3B82F6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #2563EB;
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background-color: #F3F4F6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    border: 1px solid #D1D5DB;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #E5E7EB;
    color: #374151;
    text-decoration: none;
}

.btn-success {
    background-color: #10B981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

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

.btn-danger {
    background-color: #EF4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #DC2626;
    color: white;
    text-decoration: none;
}

.btn-warning {
    background-color: #F59E0B;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-warning:hover {
    background-color: #D97706;
    color: white;
    text-decoration: none;
}

/* Form input styles */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    background-color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

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

.alert-success {
    background-color: #D1FAE5;
    border-color: #A7F3D0;
    color: #065F46;
}

.alert-error {
    background-color: #FEE2E2;
    border-color: #FECACA;
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    border-color: #FDE68A;
    color: #92400E;
}

.alert-info {
    background-color: #DBEAFE;
    border-color: #BFDBFE;
    color: #1E40AF;
}

/* Navigation styles */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 0.375rem;
}

.nav-link:hover {
    background-color: #F3F4F6;
    color: #3B82F6;
    text-decoration: none;
}

.nav-link.active {
    background-color: #EBF8FF;
    color: #3B82F6;
    border-left: 3px solid #3B82F6;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid #E5E7EB;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: #F9FAFB;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #E5E7EB;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #F3F4F6;
}

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

/* Modal styles */
.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;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: color 0.2s;
}

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

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

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

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-error {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.badge-gray {
    background-color: #F3F4F6;
    color: #374151;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .tab-button {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .space-x-8 > * + * {
        margin-left: 0.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-warning {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #E5E7EB;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-warning {
        display: none;
    }
}

/* Debug panel styles */
.debug-panel {
    background-color: #1F2937;
    color: #10B981;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.debug-panel h4 {
    color: #34D399;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.debug-panel .debug-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Impersonation banner styles */
.impersonation-banner {
    background-color: #F59E0B;
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid #D97706;
}

.impersonation-banner button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-left: 1rem;
    transition: background-color 0.2s;
}

.impersonation-banner button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Fix for common layout issues */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
}

/* Ensure proper spacing and alignment */
.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
}

/* Fix for broken grid layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Ensure consistent text colors */
.text-primary {
    color: #3B82F6;
}

.text-secondary {
    color: #6B7280;
}

.text-success {
    color: #10B981;
}

.text-danger {
    color: #EF4444;
}

.text-warning {
    color: #F59E0B;
}
