/* Reusable Components */

/* Navigation Container */
.nav-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.nav-tabs {
    display: flex;
    background: var(--light-color);
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    color: #666;
    white-space: nowrap;
    position: relative;
}

.nav-tab.active {
    background: white;
    color: var(--primary-color);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
}

/* Buttons */
.btn {
    background: var(--gradient-button);
    color: white;
    border: none;
    padding: 18px 28px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-success {
    background: var(--success-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-warning {
    background: var(--warning-color);
    color: #333;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

/* Action Buttons (in tables) */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.action-btn {
    padding: 5px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.edit-btn {
    background: var(--warning-color);
    color: #333;
}

.delete-btn {
    background: var(--danger-color);
    color: white;
}

.manage-btn {
    background: var(--primary-color);
    color: white;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    background: var(--light-color);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark-color);
    border-bottom: 1px solid #dee2e6;
}

.card-body {
    padding: 20px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Messages */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
    position: relative;
    animation: slideIn 0.3s ease;
    padding-left: 40px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.role-admin { 
    background: var(--danger-color); 
    color: white; 
}

.role-teacher { 
    background: var(--info-color); 
    color: white; 
}

.role-student { 
    background: var(--success-color); 
    color: white; 
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

/* Summary Box */
.summary-box {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.summary-stat {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.summary-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.summary-stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}