/* Custom styles for Class Management System */

/* Active navigation item */
.active-nav {
    font-weight: bold;
}

/* Animations */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.modal-backdrop.hidden {
    display: none;
}

/* Custom form styles */
.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Table responsive styles */
@media (max-width: 640px) {
    .responsive-table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* Inline editing styles */
.score-cell {
    padding: 0.25rem;
    cursor: default;
    position: relative;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.score-cell.editable {
    cursor: pointer;
    transition: all 0.2s;
}

.score-cell.editable:hover {
    background-color: #f3f4f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.score-cell.editable::after {
    content: '✎';
    position: absolute;
    right: 2px;
    top: 2px;
    font-size: 0.75rem;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.2s;
}

.score-cell.editable:hover::after {
    opacity: 1;
}

.score-cell.bg-green-50 {
    background-color: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4);
    font-weight: 500;
}

/* Status indicators */
.status-present, .status-yupo {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #10B981;
    color: white;
    font-size: 0.875rem;
}

.status-absent, .status-hayupo {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #EF4444;
    color: white;
    font-size: 0.875rem;
}

.status-late, .status-ameruhusiwa {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #F59E0B;
    color: white;
    font-size: 0.875rem;
}

.status-permitted, .status-ameruhusiwa {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #F59E0B;
    color: white;
    font-size: 0.875rem;
}

.status-not-marked, .status-haijawekwa {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #9CA3AF;
    color: white;
    font-size: 0.875rem;
}

/* Mobile status indicators - smaller version */
@media (max-width: 768px) {
    .status-present, .status-yupo,
    .status-absent, .status-hayupo,
    .status-late, .status-ameruhusiwa,
    .status-permitted, 
    .status-not-marked, .status-haijawekwa {
        padding: 0.15rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Dashboard card */
.dashboard-card {
    background-color: 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);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Button styles */
.btn-primary {
    background-color: #2563EB;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

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

.btn-secondary {
    background-color: #9ca3af;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

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

.btn-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

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

/* Utility classes */
.text-muted {
    color: #6b7280;
}

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

.text-danger {
    color: #ef4444;
}

.text-warning {
    color: #f59e0b;
}

/* Exam Grade Indicators */
.grade-a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #10B981;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-b-plus {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #3B82F6;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-b {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #6366F1;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-c {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #F59E0B;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-d {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #EF4444;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-e {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #DC2626;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.grade-f {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #6B7280;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Export to PDF styles */
.pdf-container {
    background-color: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media print, (max-width: 500px) {
    /* Make tables more compact for PDF export */
    table th, table td {
        padding: 4px 6px !important;
        font-size: 10px !important;
    }
    
    .grade-a, .grade-b-plus, .grade-b, .grade-c, .grade-d, .grade-e, .grade-f {
        padding: 2px 5px !important;
        font-size: 9px !important;
    }
    
    /* Remove hover effects in PDF */
    .score-cell.editable::after {
        display: none !important;
    }
    
    /* Ensure proper sizing */
    #printable-report {
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* Hide export button when printing */
    #export-pdf-btn {
        display: none !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .status-present, .status-yupo,
    .status-late, .status-ameruhusiwa,
    .status-permitted,
    .status-absent, .status-hayupo,
    .status-not-marked, .status-haijawekwa {
        border: 1px solid #000;
        color: #000;
        background-color: transparent;
    }
    
    .status-present::before, .status-yupo::before { content: "✓ "; }
    .status-late::before, .status-ameruhusiwa::before { content: "⌛ "; }
    .status-permitted::before { content: "⌛ "; }
    .status-absent::before, .status-hayupo::before { content: "✗ "; }
    .status-not-marked::before, .status-haijawekwa::before { content: "? "; }
    
    .print-only {
        display: block;
    }
    
    body {
        background-color: white;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    .grade-a,
    .grade-b-plus,
    .grade-b,
    .grade-c,
    .grade-d,
    .grade-e,
    .grade-f {
        border: 1px solid #000;
        color: #000;
        background-color: transparent;
    }
    
    .grade-a::before { content: "A "; }
    .grade-b-plus::before { content: "B+ "; }
    .grade-b::before { content: "B "; }
    .grade-c::before { content: "C "; }
    .grade-d::before { content: "D "; }
    .grade-e::before { content: "E "; }
    .grade-f::before { content: "F "; }
}

/* Role Switcher Styles */
.role-switcher {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}

.role-switch-container {
    position: relative;
    display: flex;
    background-color: #f3f4f6;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
}

.role-switch-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    z-index: 2;
    font-weight: 500;
    color: #4b5563;
    transition: color 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    position: relative;
}

.role-switch-btn.active {
    color: white;
}

.role-switch-slider {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 50%;
    background-color: #10b981; /* Teal color from the image */
    border-radius: 9999px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.role-switch-slider.right {
    transform: translateX(100%);
}

@media (max-width: 640px) {
    .role-switch-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Mobile card styles for exam results */
@media (max-width: 768px) {
    #exam-cards .grade-a,
    #exam-cards .grade-b-plus,
    #exam-cards .grade-b,
    #exam-cards .grade-c,
    #exam-cards .grade-d,
    #exam-cards .grade-e,
    #exam-cards .grade-f {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
    
    #exam-cards .bg-white {
        transition: all 0.2s ease;
    }
    
    #exam-cards .bg-white:active {
        transform: scale(0.98);
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
}

/* Mobile-native form styles */
@media (max-width: 768px) {
    /* Make auth container full-width with rounded corners only at top */
    #auth-container {
        max-width: 100%;
        margin: 0;
        margin-top: auto;
        border-radius: 1.5rem 1.5rem 0 0;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        transform: translateY(0);
        transition: transform 0.3s ease-out;
    }
    
    /* Enhanced modal styling for mobile */
    .modal-backdrop > div {
        margin: 1rem;
        max-width: calc(100% - 2rem) !important;
        border-radius: 1.25rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        padding: 1.5rem;
    }
    
    /* Create slide-up animation for modals */
    @keyframes slide-up {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    .modal-backdrop > div {
        animation: slide-up 0.3s ease-out;
    }
    
    /* Floating labels for form inputs */
    .mobile-input-wrapper,
    .modal-backdrop .mb-4,
    #dashboard-content form .mb-4 {
        position: relative;
        margin-bottom: 1.5rem;
    }
    
    .mobile-input-wrapper.focused,
    .modal-backdrop .mb-4.focused,
    #dashboard-content form .mb-4.focused {
        z-index: 5;
    }
    
    /* Style all input fields in modals and forms */
    .mobile-input-wrapper input,
    .modal-backdrop input[type="text"],
    .modal-backdrop input[type="tel"],
    .modal-backdrop input[type="password"],
    .modal-backdrop input[type="email"],
    .modal-backdrop input[type="number"],
    #dashboard-content form input[type="text"],
    #dashboard-content form input[type="tel"],
    #dashboard-content form input[type="password"],
    #dashboard-content form input[type="email"],
    #dashboard-content form input[type="number"] {
        height: 3.5rem;
        padding: 1.25rem 0.75rem 0.5rem;
        width: 100%;
        background-color: #f9fafb;
        border: none;
        border-radius: 0.75rem;
        font-size: 1rem;
        transition: all 0.2s;
        -webkit-appearance: none;
        appearance: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    /* Style input focus state */
    .mobile-input-wrapper input:focus,
    .modal-backdrop input:focus,
    #dashboard-content form input:focus {
        background-color: #f3f4f6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
        outline: none;
    }
    
    /* Style input labels */
    .mobile-input-wrapper label,
    .modal-backdrop label,
    #dashboard-content form label {
        display: block;
        font-size: 0.9rem;
        font-weight: 500;
        color: #4b5563;
        margin-bottom: 0.5rem;
    }
    
    /* Special styling for floating labels */
    .mobile-input-wrapper label {
        position: absolute;
        left: 0.75rem;
        top: 1.2rem;
        font-size: 1rem;
        color: #6b7280;
        transition: all 0.2s ease;
        pointer-events: none;
        margin-bottom: 0;
    }
    
    .mobile-input-wrapper input:focus + label,
    .mobile-input-wrapper input:not(:placeholder-shown) + label {
        top: 0.5rem;
        font-size: 0.75rem;
        color: #2563eb;
    }
    
    /* Form buttons with tactile feedback - apply to all buttons */
    .mobile-button,
    .modal-backdrop button[type="submit"],
    #dashboard-content form button[type="submit"] {
        width: 100%;
        background-color: #2563eb;
        color: white;
        padding: 0.875rem;
        border-radius: 0.75rem;
        font-weight: 600;
        font-size: 1.125rem;
        border: none;
        position: relative;
        overflow: hidden;
        transform: translateY(0);
        transition: transform 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-button:active,
    .modal-backdrop button[type="submit"]:active,
    #dashboard-content form button[type="submit"]:active {
        transform: translateY(2px);
    }
    
    .mobile-button::after,
    .modal-backdrop button[type="submit"]::after,
    #dashboard-content form button[type="submit"]::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 5px;
        height: 5px;
        background: rgba(255, 255, 255, 0.5);
        opacity: 0;
        border-radius: 100%;
        transform: scale(1) translate(-50%, -50%);
        transform-origin: 50% 50%;
    }
    
    .mobile-button:active::after,
    .modal-backdrop button[type="submit"]:active::after,
    #dashboard-content form button[type="submit"]:active::after {
        opacity: 1;
        transform: scale(20) translate(-50%, -50%);
        transition: transform 0.4s, opacity 0.25s;
    }
    
    /* Secondary/cancel buttons */
    .modal-backdrop button[type="button"]:not(.role-switch-btn):not(.mobile-tab-button),
    #dashboard-content form button[type="button"]:not(.role-switch-btn):not(.mobile-tab-button) {
        padding: 0.875rem;
        border-radius: 0.75rem;
        font-weight: 500;
        border: none;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Enhanced tab buttons for native feel */
    .mobile-tabs {
        display: flex;
        margin-bottom: 1.5rem;
        background-color: #f3f4f6;
        border-radius: 0.75rem;
        padding: 0.25rem;
    }
    
    .mobile-tab-button {
        flex: 1;
        padding: 0.75rem;
        text-align: center;
        font-weight: 500;
        color: #6b7280;
        border-radius: 0.5rem;
        border: none;
        background: none;
        transition: all 0.3s;
        position: relative;
        z-index: 1;
    }
    
    .mobile-tab-button.active {
        color: #2563eb;
        background-color: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Role switcher enhancements for mobile */
    .role-switcher {
        margin-bottom: 1.5rem;
    }
    
    .role-switch-container {
        height: 3rem;
    }
    
    .role-switch-btn {
        font-size: 0.9rem;
        letter-spacing: 0.02em;
    }
    
    /* Native-looking select dropdown */
    .mobile-select,
    .modal-backdrop select,
    #dashboard-content form select {
        -webkit-appearance: none;
        appearance: none;
        background-color: #f9fafb;
        border: none;
        border-radius: 0.75rem;
        padding: 0.875rem;
        font-size: 1rem;
        height: 3.5rem;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 1rem;
        transition: all 0.2s;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .mobile-select:focus,
    .modal-backdrop select:focus,
    #dashboard-content form select:focus {
        background-color: #f3f4f6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
        outline: none;
    }
    
    /* Special handling for file inputs */
    .modal-backdrop input[type="file"],
    #dashboard-content form input[type="file"] {
        background-color: #f9fafb;
        border: 1px dashed #d1d5db;
        border-radius: 0.75rem;
        padding: 1.5rem;
        text-align: center;
        cursor: pointer;
        height: auto;
        box-shadow: none;
    }
    
    /* Special handling for textareas */
    .modal-backdrop textarea,
    #dashboard-content form textarea {
        background-color: #f9fafb;
        border: none;
        border-radius: 0.75rem;
        padding: 0.875rem;
        font-size: 1rem;
        transition: all 0.2s;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        min-height: 6rem;
        width: 100%;
    }
    
    .modal-backdrop textarea:focus,
    #dashboard-content form textarea:focus {
        background-color: #f3f4f6;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
        outline: none;
    }
}

/* Ripple effect for buttons */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    animation: ripple-animation 0.6s linear;
    opacity: 0;
    pointer-events: none;
}

@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
} 