/**
 * SSO System Styles
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* Login/Register Page */
.card {
    border: none;
    border-radius: 8px;
}

.card-body {
    padding: 2rem;
}

/* Admin Dashboard */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

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

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

/* Table styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: #f8f9fa;
}

/* Badge styles */
.badge {
    padding: 0.4rem 0.6rem;
    font-weight: 500;
}

/* Button styles */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Card hover effect */
.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
    transition: box-shadow 0.3s ease;
}

/* Alert customization */
.alert {
    border-radius: 6px;
    border: none;
}

/* Modal customization */
.modal-content {
    border-radius: 8px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
}

/* Form improvements */
.form-control, .form-select {
    border-radius: 6px;
}

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

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Pagination */
.pagination {
    margin-top: 1rem;
}

.page-link {
    color: var(--primary-color);
    border-radius: 6px;
    margin: 0 2px;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
}

/* Settings Sidebar Styles */
.settings-group {
    border-bottom: 1px solid #e9ecef;
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-group-header {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border: none;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.settings-group-header:hover {
    background-color: #e9ecef;
}

.settings-group-header i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    font-style: normal;
}

.settings-link {
    padding: 0.6rem 1rem 0.6rem 2rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.settings-link:hover {
    background-color: #f8f9fa;
    border-left-color: var(--primary-color);
}

.settings-link.active {
    background-color: #e7f1ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

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

/* Settings sidebar column max width */
#settingsPage .col-md-3 {
    max-width: 290px;
}

/* Module Management Styles */
.module-stat-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.module-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.module-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.module-meta small {
    line-height: 1.8;
}

.module-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.module-actions .btn {
    flex: 1;
    min-width: 100px;
}

/* Make sidebar sticky on larger screens */
@media (min-width: 768px) {
    #settingsSidebar {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    #settingsSidebar::-webkit-scrollbar {
        width: 6px;
    }

    #settingsSidebar::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    #settingsSidebar::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

    #settingsSidebar::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .card {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    .table {
        color: #e0e0e0;
    }

    .table-striped tbody tr:nth-of-type(odd) {
        background-color: #2a2a2a;
    }

    .settings-group-header {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    .settings-group-header:hover {
        background-color: #333333;
    }

    .settings-link:hover {
        background-color: #2a2a2a;
    }

    .settings-link.active {
        background-color: #1a3a5a;
        color: #5ba3ff;
    }
}
