* {
    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: 1200px;
    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: 50px;
    width: auto;
}

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

.logo h1 {
    color: #1a1a2e;
    font-size: 1.5em;
}

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

.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;
}

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

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

.login-card h2 {
    color: #1a1a2e;
    margin-bottom: 10px;
}

.login-card > p {
    color: #666;
    margin-bottom: 25px;
}

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

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

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

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

.login-form button {
    padding: 15px;
    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;
}

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

.login-note {
    margin-top: 20px;
    font-size: 0.85em;
    color: #999;
}

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

/* Student Bar */
.student-bar {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

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

.organizer-avatar {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.organizer-bar {
    border-left: 4px solid #27ae60;
}

.student-info strong {
    display: block;
    color: #1a1a2e;
}

.student-info span {
    color: #666;
    font-size: 0.9em;
}

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

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

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

.tab:hover:not(.active) {
    background: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Form Card */
.form-card, .submissions-card, .activities-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.form-card h2, .submissions-card h2, .activities-panel h2 {
    color: #1a1a2e;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    color: #667eea;
    font-weight: 600;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 20px;
}

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

.required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Level Options */
.level-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.level-option {
    cursor: pointer;
    position: relative;
}

.level-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.level-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.level-option input:checked + .level-card {
    background: #e8f0ff;
    border-color: #667eea;
}

.level-number {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
}

.level-title {
    display: block;
    font-weight: 600;
    color: #333;
    margin: 5px 0;
}

.level-desc {
    display: block;
    font-size: 0.8em;
    color: #666;
}

/* Skills Selector */
.skills-selector {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
}

.selected-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.no-skills {
    color: #999;
    font-style: italic;
}

.skill-tag {
    background: white;
    border: 1px solid #667eea;
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.skill-level-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
}

.remove-skill {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 5px;
}

.btn-add-skill {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-add-skill:hover {
    background: #5a6fd6;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-submit, .btn-secondary {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

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

/* Submissions List */
.submissions-list {
    max-height: 500px;
    overflow-y: auto;
}

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

.submission-item.status-approved { border-left-color: #27ae60; }
.submission-item.status-pending { border-left-color: #f39c12; }
.submission-item.status-rejected { border-left-color: #e74c3c; }

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.submission-header h4 {
    color: #1a1a2e;
}

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

.submission-date {
    font-size: 0.85em;
    color: #999;
}

.reject-reason {
    background: #fff0f0;
    color: #c0392b;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
}

.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; }
.status-badge.draft { background: #e2e3e5; color: #383d41; }

/* Activity Cards */
.activity-card {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.activity-card.status-approved { border-left-color: #27ae60; }
.activity-card.status-pending { border-left-color: #f39c12; }
.activity-card.status-rejected { border-left-color: #e74c3c; }
.activity-card.status-draft { border-left-color: #95a5a6; }

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.activity-header h3 {
    color: #1a1a2e;
    font-size: 1.1em;
}

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

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

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

.activity-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: #f0f4ff;
    color: #667eea;
}

.btn-submit-approval {
    background: #667eea;
    color: white;
}

.btn-students {
    background: #e8f5e9;
    color: #27ae60;
}

/* Modal */
.modal-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;
    padding: 20px;
}

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

.modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    color: #1a1a2e;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.success-modal {
    text-align: center;
    padding: 40px;
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.modal-note {
    margin-top: 15px;
    color: #666;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Skill Modal */
.skill-modal {
    max-width: 700px;
}

.skill-categories {
    max-height: 400px;
    overflow-y: auto;
}

.skill-domain {
    margin-bottom: 20px;
}

.skill-domain h4 {
    color: #667eea;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
}

.skill-item.selected {
    background: #e8f0ff;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-info label {
    cursor: pointer;
}

.skill-level {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Students Modal */
.students-modal {
    max-width: 500px;
}

.students-modal textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: monospace;
    resize: vertical;
}

.student-count {
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

/* Loading */
.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: 2000;
}

.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: 768px) {
    .container {
        padding: 15px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

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

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

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