/* Main CSS file for EduHub */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn-primary {
    background: #6200ea;
    color: white;
}

.btn-primary:hover {
    background: #3700b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top-color: #6200ea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6200ea;
    box-shadow: 0 0 0 3px rgba(98, 0, 234, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
}

.success-message {
    color: #10b981;
    font-size: 14px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Skeleton Loading Animations - Global Standard for Perceived Performance
   ───────────────────────────────────────────────────────────────────────────── */

/* Skeleton Loading Container */
.skeleton-loading {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Skeleton Card Styles */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}

.skeleton-header {
    margin-bottom: 16px;
}

.skeleton-title {
    height: 20px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-footer {
    margin-top: 16px;
}

/* Skeleton Text Elements */
.skeleton-text {
    height: 16px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-short {
    height: 12px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-medium {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-long {
    height: 16px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-button {
    height: 36px;
    background: #e5e7eb;
    border-radius: 6px;
    width: 100px;
}

/* Skeleton List Styles */
.skeleton-list {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    background: #e5e7eb;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-list .skeleton-content {
    flex: 1;
}

/* Skeleton Table Styles */
.skeleton-table {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
}

.skeleton-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.skeleton-cell {
    background: #e5e7eb;
    border-radius: 4px;
    height: 20px;
    flex: 1;
}

.skeleton-cell.skeleton-short {
    flex: 0.5;
}

.skeleton-cell.skeleton-medium {
    flex: 1;
}

.skeleton-cell.skeleton-long {
    flex: 2;
}

/* Skeleton Profile Styles */
.skeleton-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}

.skeleton-avatar-large {
    width: 80px;
    height: 80px;
    background: #e5e7eb;
    border-radius: 50%;
}

.skeleton-profile .skeleton-content {
    text-align: center;
    width: 100%;
}

/* Shine Animation - Key Performance Enhancement */
@keyframes shine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-shine {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        #e5e7eb 0%,
        #f0f0f0 20%,
        #e5e7eb 40%,
        #f0f0f0 60%,
        #e5e7eb 80%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: shine 2s ease-in-out infinite;
}

/* Enhanced Shine Animation for Different Skeleton Types */
.skeleton-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shine-overlay 2s ease-in-out infinite;
}

@keyframes shine-overlay {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Loading State Styles */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #64748b;
}

.loading-spinner i {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

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

/* Empty State Styles */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.empty-icon {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-message h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.empty-message p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Error State Styles */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #dc2626;
}

.error-icon {
    font-size: 48px;
    color: #dc2626;
    margin-bottom: 16px;
}

.error-message h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #dc2626;
}

.error-message p {
    font-size: 14px;
    color: #7f1d1d;
    margin: 0 0 16px 0;
}

.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Skeleton Responsive Design */
@media (max-width: 768px) {
    .skeleton-card {
        margin-bottom: 12px;
        padding: 16px;
    }
    
    .skeleton-list {
        padding: 12px;
    }
    
    .skeleton-table {
        padding: 12px;
    }
    
    .loading-state {
        padding: 30px 15px;
    }
    
    .empty-state,
    .error-state {
        padding: 40px 15px;
    }
}
