/* Common CSS Styles for GMCP LMS Portals */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background-color: #f5f7fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Common Message Styles */
.message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

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

.error-message {
    background: #fff3f3;
    color: #d63031;
    border-left: 4px solid #d63031;
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fff4;
    color: #00b894;
    border-left: 4px solid #00b894;
    border: 1px solid #bbf7d0;
}

.info-message {
    background: #e8f4fd;
    color: #0066cc;
    border-left: 4px solid #0066cc;
    border: 1px solid #bfdbfe;
}

.warning-message {
    background: #fffbeb;
    color: #d97706;
    border-left: 4px solid #d97706;
    border: 1px solid #fed7aa;
}

/* Common Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 600;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #00b894;
    color: white;
}

.btn-danger {
    background: #d63031;
    color: white;
}

.btn-warning {
    background: #d97706;
    color: white;
}

.btn-info {
    background: #0066cc;
    color: white;
}

.btn-light {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 12px 12px 0 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0;
    color: #333;
}

.card-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.card-body {
    padding: 0;
}

.card-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
    margin: 20px -20px -20px -20px;
    border-radius: 0 0 12px 12px;
}

/* Common Grid System */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
    min-width: 0;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.667%; max-width: 16.667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.667%; max-width: 66.667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 768px) {
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .row { margin: 0 -5px; }
    .col { padding: 0 5px; }
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.form-check-input {
    width: auto;
    margin: 0;
}

.form-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Common Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.table td {
    font-size: 14px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Common Badge/Tag Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: #667eea; color: white; }
.badge-secondary { background: #6c757d; color: white; }
.badge-success { background: #00b894; color: white; }
.badge-danger { background: #d63031; color: white; }
.badge-warning { background: #d97706; color: white; }
.badge-info { background: #0066cc; color: white; }
.badge-light { background: #f8f9fa; color: #333; border: 1px solid #dee2e6; }

/* Common Status Indicators */
.status-active { color: #00b894; }
.status-inactive { color: #6c757d; }
.status-pending { color: #d97706; }
.status-danger { color: #d63031; }

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.active { background: #00b894; }
.status-dot.inactive { background: #6c757d; }
.status-dot.pending { background: #d97706; }
.status-dot.danger { background: #d63031; }

/* Common Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Common Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: #667eea; }
.text-secondary { color: #6c757d; }
.text-success { color: #00b894; }
.text-danger { color: #d63031; }
.text-warning { color: #d97706; }
.text-info { color: #0066cc; }
.text-muted { color: #666; }

.bg-primary { background: #667eea; }
.bg-secondary { background: #6c757d; }
.bg-success { background: #00b894; }
.bg-danger { background: #d63031; }
.bg-warning { background: #d97706; }
.bg-info { background: #0066cc; }
.bg-light { background: #f8f9fa; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.border { border: 1px solid #dee2e6; }
.border-0 { border: none; }
.border-radius { border-radius: 8px; }
.rounded { border-radius: 8px; }
.rounded-circle { border-radius: 50%; }

.shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.shadow-sm { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
