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

body {
    font-family: 'Sarabun', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 60px;
    width: auto;
}

.logo-icon {
    font-size: 3em;
}

.logo h1 {
    color: #1a1a2e;
    font-size: 1.8em;
    font-weight: 700;
}

.logo p {
    color: #666;
    font-size: 0.95em;
}

/* Organization Banner */
.org-banner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.org-logo {
    height: 50px;
    width: auto;
}

.org-info {
    display: flex;
    flex-direction: column;
}

.org-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #1a1a2e;
}

.org-sub {
    font-size: 0.9em;
    color: #555;
}

.org-sub-th {
    font-size: 0.85em;
    color: #888;
}

.nav-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #667eea;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    background: #f0f4ff;
}

/* Search Section */
.search-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.search-card {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

.search-card h2 {
    color: #1a1a2e;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.search-card > p {
    color: #666;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-form input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
}

.search-form input[type="password"] {
    letter-spacing: 3px;
}

.search-form input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-hint {
    margin-top: 15px;
    font-size: 0.85em;
    color: #888;
}

.search-form button {
    width: 100%;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.error-message {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 0.9em;
    min-height: 20px;
}

/* Dashboard Section */
.dashboard-section {
    animation: fadeIn 0.5s ease;
}

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

/* Student Info Card */
.student-info-card {
    background: white;
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.student-avatar {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2em;
    font-weight: 700;
}

.student-details {
    flex: 1;
}

.student-details h2 {
    color: #1a1a2e;
    font-size: 1.5em;
}

.student-details p {
    color: #666;
    font-size: 0.95em;
}

.logout-btn {
    padding: 12px 24px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.skill-stat {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.stat-card.skill-stat .stat-number {
    color: #27ae60;
}

.stat-icon {
    font-size: 2.5em;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

/* Chart Card */
.chart-card, .competency-card, .activities-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.chart-card h3, .competency-card h3, .activities-card h3 {
    color: #1a1a2e;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.chart-container {
    position: relative;
    height: 350px;
}

/* Competency Table */
.competency-table-wrapper {
    max-height: 350px;
    overflow-y: auto;
}

.competency-table {
    width: 100%;
    border-collapse: collapse;
}

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

.competency-table th {
    background: #f8f9ff;
    font-weight: 600;
    color: #1a1a2e;
    position: sticky;
    top: 0;
}

.competency-table tr:hover {
    background: #f8f9ff;
}

.level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
}

.level-0 { background: #f5f5f5; color: #999; }
.level-1 { background: #e3f2fd; color: #1976d2; }
.level-2 { background: #e8f5e9; color: #388e3c; }
.level-3 { background: #fff3e0; color: #f57c00; }
.level-4 { background: #fce4ec; color: #c2185b; }

/* Activities Card */
.activities-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: none;
    background: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: #e0e0e0;
}

.activities-list {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.activity-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.activity-item.status-approved {
    border-left-color: #27ae60;
}

.activity-item.status-pending {
    border-left-color: #f39c12;
}

.activity-item.status-rejected {
    border-left-color: #e74c3c;
}

.activity-title {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.activity-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.activity-skills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.skill-tag {
    background: #e8f0ff;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.show {
    display: flex;
}

.loading-box {
    background: white;
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
}

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

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

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

.empty-state .icon {
    font-size: 4em;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 15px 20px;
    }

    .logo h1 {
        font-size: 1.4em;
    }

    .search-card {
        padding: 30px 20px;
    }

    .student-info-card {
        flex-direction: column;
        text-align: center;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form input {
        min-width: auto;
        width: 100%;
    }

    .search-form button {
        width: 100%;
    }
}

/* ============================================
   NEW DASHBOARD STYLES
   ============================================ */

/* Chart Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #555;
}

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-color.current {
    background: #667eea;
    height: 6px;
}

.legend-color.min {
    background: #f1c40f;
    border: 1px dashed #f1c40f;
}

.legend-color.ideal {
    background: #27ae60;
    border: 1px dashed #27ae60;
}

.chart-note {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #f0f7ff;
    border-radius: 8px;
    font-size: 0.9em;
    color: #2980b9;
}

/* Score Stat Card */
.stat-card.score-stat {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.stat-card.score-stat .stat-number {
    color: #e67e22;
}

/* Competency Summary */
.competency-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.domain-summary {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.domain-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
}

.domain-summary-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.domain-num {
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
}

.domain-summary-level {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avg-level {
    font-weight: 700;
    font-size: 1.1em;
    color: #333;
}

.status-text {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-text.excellent {
    background: #d4edda;
    color: #155724;
}

.status-text.good {
    background: #cce5ff;
    color: #004085;
}

.status-text.low {
    background: #fff3cd;
    color: #856404;
}

.domain-summary-body {
    padding: 10px 15px;
}

.sub-skill-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.sub-skill-code {
    font-weight: 600;
    color: #667eea;
    width: 40px;
}

.sub-skill-name {
    flex: 1;
    color: #555;
    font-size: 0.9em;
}

.sub-skill-level {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.sub-skill-level.excellent {
    background: #d4edda;
    color: #155724;
}

.sub-skill-level.good {
    background: #cce5ff;
    color: #004085;
}

.sub-skill-level.developing {
    background: #fff3cd;
    color: #856404;
}

.sub-skill-level.none {
    background: #f8f9fa;
    color: #999;
}

/* New Activity Items */
.activity-item-new {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
    transition: transform 0.2s;
}

.activity-item-new:hover {
    transform: translateX(5px);
}

.activity-item-new.status-approved {
    border-left-color: #27ae60;
}

.activity-item-new.status-pending {
    border-left-color: #f39c12;
}

.activity-item-new.status-rejected {
    border-left-color: #e74c3c;
}

.activity-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.activity-info {
    flex: 1;
}

.activity-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.activity-title {
    font-weight: 600;
    font-size: 1.05em;
    color: #333;
}

.activity-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #666;
    flex-wrap: wrap;
}

.activity-score {
    text-align: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    min-width: 70px;
}

.score-number {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
}

.score-label {
    font-size: 0.75em;
    opacity: 0.9;
}

.activity-skills-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.activity-skill-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid #667eea;
}

.skill-domain-name {
    font-size: 0.8em;
    color: #666;
    min-width: 120px;
}

.skill-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.skill-tag-new {
    background: #f0f4ff;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
}

.skill-tag-new strong {
    color: #27ae60;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-top: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.info-section h3 {
    color: #1a1a2e;
    margin-bottom: 25px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-domain {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.domain-header {
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.domain-number {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.domain-name {
    font-weight: 600;
    font-size: 1.1em;
}

.domain-body {
    padding: 15px 20px;
    background: #f8f9fa;
}

.domain-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.sub-skills {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sub-skills li {
    padding: 6px 0;
    font-size: 0.9em;
    color: #555;
    border-bottom: 1px solid #e9ecef;
}

.sub-skills li:last-child {
    border-bottom: none;
}

.sub-skills li strong {
    color: #667eea;
    margin-right: 5px;
}

/* Level Info */
.level-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.level-info h4 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
}

.level-1-bg { background: #ffebee; }
.level-2-bg { background: #fff8e1; }
.level-3-bg { background: #e8f5e9; }
.level-4-bg { background: #e3f2fd; }

.level-badge-big {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.level-1-bg .level-badge-big { background: #e57373; }
.level-2-bg .level-badge-big { background: #ffb74d; }
.level-3-bg .level-badge-big { background: #81c784; }
.level-4-bg .level-badge-big { background: #64b5f6; }

.level-detail strong {
    display: block;
    color: #333;
    margin-bottom: 3px;
}

.level-detail p {
    font-size: 0.85em;
    color: #666;
    margin: 0;
}

.level-note {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-align: center;
}

/* Responsive for new elements */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .level-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-main {
        flex-direction: column;
    }
    
    .activity-score {
        width: 100%;
    }
    
    .activity-skill-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .skill-domain-name {
        margin-bottom: 5px;
    }
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 15px;
}

.footer-logo {
    height: 80px;
    width: auto;
    border-radius: 10px;
}

.footer p {
    color: #555;
    font-size: 0.95em;
    margin: 5px 0;
}

/* Responsive adjustments for org-banner and footer */
@media (max-width: 768px) {
    .org-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .org-info {
        align-items: center;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .org-logo {
        height: 40px;
    }
}

/* Social Links Section */
.social-links-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 16px;
    padding: 25px;
    margin-top: 25px;
    border: 2px solid #27ae60;
    text-align: center;
}

.social-links-section h4 {
    color: #1a472a;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.social-link.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #166fe5 100%);
    color: white;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.social-icon {
    font-size: 1.3em;
}

.social-text {
    font-size: 0.95em;
}

@media (max-width: 480px) {
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-link {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* Reject Reason Box */
.reject-reason-box {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.reject-reason-label {
    font-weight: 600;
    color: #c62828;
    font-size: 0.9em;
}

.reject-reason-text {
    color: #b71c1c;
    font-size: 0.9em;
    line-height: 1.4;
}
