/* 
 * Custom Stylesheet
 * Behavior Points System
 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, box-shadow;
}

.card:hover {
    -webkit-transform: translateY(-2px) translateZ(0);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: bold;
    border-radius: 10px 10px 0 0 !important;
}

/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Points Display */
.points-display {
    text-align: center;
    padding: 30px;
}

.points-display .points-value {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.points-display .points-label {
    font-size: 1.2rem;
    color: #6c757d;
    margin-top: 10px;
}

/* Point Transaction Items */
.transaction-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.transaction-item:hover {
    background-color: #f8f9fa;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-positive {
    border-left: 4px solid var(--success-color);
}

.transaction-negative {
    border-left: 4px solid var(--danger-color);
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-lg {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
}

.btn-gradient:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: white;
}

/* Category Buttons */
.category-btn {
    display: inline-block;
    padding: 15px 20px;
    margin: 5px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    text-align: center;
}

.category-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.category-btn.active {
    border-color: #000;
    font-weight: bold;
}

.category-positive {
    background-color: #d4edda;
    color: #155724;
}

.category-negative {
    background-color: #f8d7da;
    color: #721c24;
}

/* Tables */
.table {
    background: white;
    border-radius: 10px;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.table thead th {
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Responsive */
@media (max-width: 768px) {
    .points-display .points-value {
        font-size: 3rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .category-btn {
        display: block;
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

/* Progress Bars */
.progress {
    height: 25px;
    border-radius: 12px;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Activity Log */
.activity-item {
    padding: 10px 15px;
    border-left: 3px solid #e9ecef;
    margin-bottom: 10px;
}

.activity-item.severity-warning {
    border-left-color: var(--warning-color);
}

.activity-item.severity-critical {
    border-left-color: var(--danger-color);
}

.activity-time {
    font-size: 0.85rem;
    color: #6c757d;
}
/* ========================================
   STUDENT BREAKDOWN MODAL STYLES
   ======================================== */

/* Modal Enhancements */
.modal-xl {
    max-width: 1200px;
}

.modal-content {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.modal-header.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    padding: 1.5rem;
}

.student-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalStudentInfo {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
}

.summary-section .card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.summary-section .card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    -webkit-transform: translateY(-5px) translateZ(0);
    transform: translateY(-5px) translateZ(0);
}

/* Tabs Styling */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

/* Timeline Styling */
.activity-timeline {
    position: relative;
    padding-left: 40px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #e9ecef 100%);
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
    animation: slideInLeft 0.4s ease;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    z-index: 1;
}

.timeline-item.positive::before {
    border-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

.timeline-item.negative::before {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.timeline-item .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
}

/* Category Items */
.category-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateX(8px);
    background: #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.category-item .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
}

/* Charts Container */
canvas {
    max-height: 300px;
}

/* Progress Bars in Modal */
.modal-body .progress {
    height: 28px;
    border-radius: 14px;
    background: #e9ecef;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.modal-body .progress-bar {
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alert in Modal */
.modal-body .alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.25rem;
}

.modal-body .alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.05) 100%);
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Student Name Link */
.student-name-link {
    color: #212529;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
}

.student-name-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.student-name-link:hover {
    color: var(--primary-color);
}

.student-name-link:hover::after {
    width: 100%;
}

/* Loading State */
#modalLoading {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#modalLoading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Scrollbar Styling */
.activity-timeline::-webkit-scrollbar {
    width: 8px;
}

.activity-timeline::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.activity-timeline::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.activity-timeline::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive Modal */
@media (max-width: 992px) {
    .modal-xl {
        max-width: 95%;
    }
    
    .activity-timeline {
        padding-left: 30px;
    }
    
    .activity-timeline::before {
        left: 10px;
    }
    
    .timeline-item::before {
        left: -24px;
    }
}

@media (max-width: 576px) {
    .summary-section .card {
        margin-bottom: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Print Modal Content */
@media print {
    .modal-header,
    .modal-footer,
    .nav-tabs {
        display: none !important;
    }
    
    .tab-content .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }
}

/* ==========================================
   CREDENTIAL CARD STYLES
   ========================================== */

.credential-card {
    width: 480px;
    max-width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.credential-card:hover {
    transform: none;
}

.credential-header {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    color: white;
    padding: 24px 20px;
    text-align: center;
}

.credential-header h3 {
    font-size: 20px;
    margin: 8px 0 4px;
    font-weight: 700;
}

.credential-subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
}

.credential-logo {
    font-size: 32px;
}

.credential-body {
    padding: 24px;
}

.credential-photo-section {
    text-align: center;
    margin-bottom: 20px;
}

.credential-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0d6efd;
}

.credential-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e9ecef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #adb5bd;
    border: 3px solid #dee2e6;
}

.credential-role-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.credential-row:last-child {
    border-bottom: none;
}

.credential-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.credential-label i {
    width: 20px;
    text-align: center;
    margin-right: 6px;
}

.credential-value {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    text-align: right;
}

.credential-username {
    color: #0d6efd;
    font-size: 16px;
}

.credential-password {
    color: #dc3545;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 1px;
}

.credential-password-row {
    background: #fff8e1;
    margin: 8px -12px;
    padding: 12px !important;
    border-radius: 8px;
    border: 1px dashed #ffc107 !important;
}

.credential-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 12px 0;
}

.credential-meta .credential-label {
    font-size: 11px;
}

.credential-meta .credential-value {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.credential-footer {
    background: #f8f9fa;
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.credential-footer p {
    font-size: 12px;
    color: #6c757d;
    margin: 4px 0;
}

.credential-footer p i {
    margin-right: 4px;
}

.credential-warning {
    color: #dc3545 !important;
    font-weight: 600;
}

.credential-date {
    font-size: 11px !important;
    color: #adb5bd !important;
}

@media (max-width: 576px) {
    .credential-card {
        width: 100%;
    }
    .credential-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .credential-value {
        text-align: left;
        margin-top: 2px;
    }
}