:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --warning: #f9c74f;
    --danger: #f94144;
    --info: #90e0ef;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --public-primary: #22577a;
    --public-secondary: #38a3a5;
    --public-light: #57cc99;
    --body-bg: #f5f8ff;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Sarabun', sans-serif;
}

body {
    background-color: var(--body-bg);
    color: var(--dark);
    font-size: 16px;
    line-height: 1.6;
    padding: 20px;
}

.container {
    width: 94%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    overflow: hidden;
}

/* Header and Navigation */
header {
    background-color: var(--public-primary);
    color: white;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 100;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 8px;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.nav-links a i {
    margin-right: 6px;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-login {
    background-color: white;
    color: var(--public-primary);
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.btn-login i {
    margin-right: 6px;
}

.btn-login:hover {
    background-color: var(--light);
    transform: translateY(-2px);
}

/* Main Content */
.main-section {
    padding: 20px 0;
}

/* Steps */
.steps-container {
    margin-bottom: 40px;
}

.steps {
    display: flex;
    margin-bottom: 30px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 35px;
    left: 60%;
    width: 80%;
    height: 2px;
    background-color: var(--light);
    z-index: 1;
}

.step.active:not(:last-child)::after {
    background-color: var(--public-primary);
}

.step-number {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray);
    margin: 0 auto 15px;
    position: relative;
    z-index: 2;
}

.step.active .step-number {
    background-color: var(--public-primary);
    color: white;
}

.step-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}

.step.active .step-title {
    color: var(--public-primary);
}

.step-desc {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Form Styles */
.form-header {
    margin-bottom: 30px;
    text-align: center;
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--public-primary);
    margin-bottom: 10px;
}

.form-subtitle {
    color: var(--gray);
    font-size: 1rem;
}

.form-section {
    margin-bottom: 30px;
    border-left: 3px solid var(--public-primary);
    padding-left: 15px;
    background-color: white;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 20px 20px 20px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--public-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

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

.form-group.span-2 {
    grid-column: span 2;
}

.form-group.span-3 {
    grid-column: span 3;
}

.form-group.span-4 {
    grid-column: span 4;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--public-primary);
    box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.1);
}

.form-input::placeholder {
    color: #adb5bd;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--public-primary);
    box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.1);
}

.form-checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.form-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.form-checkbox-label {
    font-size: 0.95rem;
    cursor: pointer;
}

/* Tab Navigation */
.tab-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 40px;
}

.tabs {
    display: flex;
    background-color: var(--light);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
    border: none;
}

.tab-button {
    flex: 1;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background-color: var(--light);
    color: var(--gray);
    font-size: 1rem;
    box-shadow: none;
}

.tab-button.active {
    background-color: var(--public-primary);
    color: white;
    border: none;
    position: relative;
}

.tab-button:hover:not(.active) {
    background-color: var(--gray-200);
    color: var(--dark);
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
    background-color: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

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

.tab-content.active {
    display: block;
}

/* Assessment Table */
.assessment-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 25px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.assessment-table th,
.assessment-table td {
    border: 1px solid var(--gray-200);
    padding: 12px 15px;
    text-align: left;
}

.assessment-table th {
    background-color: var(--public-primary);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.assessment-table tr:nth-child(even) {
    background-color: var(--gray-50);
}

.assessment-table tr:hover {
    background-color: rgba(34, 87, 122, 0.05);
}

.assessment-table textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    resize: vertical;
}

.assessment-table textarea:focus {
    border-color: var(--public-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.1);
}

.score-input {
    width: 70px;
    text-align: center;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px;
    background-color: white;
}

.score-input:focus {
    border-color: var(--public-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.1);
}

/* Rating Grid */
.rating-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.rating-grid-2 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.rating-option {
    text-align: center;
    padding: 8px 4px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    background-color: white;
}

.rating-option:hover {
    border-color: var(--public-primary);
    background-color: rgba(34, 87, 122, 0.05);
}

.rating-option.selected {
    background-color: var(--public-primary);
    color: white;
    font-weight: 600;
    border-color: var(--public-primary);
    box-shadow: 0 2px 5px rgba(34, 87, 122, 0.2);
    transform: scale(1.05);
}

/* Summary Table */
table.summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 25px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

table.summary-table th,
table.summary-table td {
    border: 1px solid var(--gray-200);
    padding: 15px;
    text-align: center;
}

table.summary-table th {
    background-color: var(--public-primary);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

table.summary-table tr:nth-child(even) {
    background-color: var(--gray-50);
}

table.summary-table tr:hover {
    background-color: rgba(34, 87, 122, 0.05);
}

table.summary-table tr:last-child {
    font-weight: 700;
    background-color: #f0f7ff;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn i {
    margin-right: 8px;
}

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

.btn-primary:hover {
    background-color: var(--public-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

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

.btn-secondary:hover {
    background-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.btn-danger:hover {
    background-color: #e63e41;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Success Message */
.success-message {
    background-color: rgba(87, 204, 153, 0.1);
    border-left: 4px solid var(--public-light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideIn 0.5s ease;
}

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

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--public-light);
    color: white;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* Remark Section */
.remark-section {
    margin-top: 40px;
    border: 1px solid var(--gray-200);
    padding: 20px;
    border-radius: 10px;
    background-color: var(--gray-50);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.remark-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--gray-700);
    font-size: 16px;
}

/* Signature Section */
.signature-section {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.signature-box {
    text-align: center;
    width: 45%;
    padding: 25px;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    background-color: var(--gray-50);
}

.signature-line {
    margin: 50px auto 15px;
    width: 80%;
    border-bottom: 1px solid var(--gray-500);
}

/* Footer */
footer {
    background-color: var(--public-primary);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
    border-radius: var(--border-radius);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.footer-logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.footer-text {
    margin-bottom: 20px;
    opacity: 0.9;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.footer-links a i {
    margin-right: 10px;
}

.footer-links a:hover {
    opacity: 1;
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.footer-contact-icon {
    margin-right: 15px;
    color: var(--public-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
    padding: 20px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    
    .form-grid,
    .form-grid-4,
    .signature-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    
    .form-grid-2,
    .signature-section {
        grid-template-columns: 1fr;
    }
    
    .steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .step {
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .step-number {
        margin: 0 15px 0 0;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .signature-box {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 20px 15px;
    }
    
    .form-grid,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-group.span-2,
    .form-group.span-3,
    .form-group.span-4 {
        grid-column: span 1;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .tab-content {
        padding: 20px 15px;
    }
    
    .assessment-table {
        font-size: 0.9rem;
    }
    
    .assessment-table th,
    .assessment-table td {
        padding: 8px;
    }
}

/* Print styles */
@media print {
    body {
        background-color: white;
        background-image: none;
        padding: 0;
        margin: 0;
    }
    
    .container {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }
    
    header,
    .tabs,
    .actions,
    button,
    .tab-button,
    .btn-group,
    footer {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
        border: none;
        padding: 10px 0;
        margin-bottom: 20px;
        box-shadow: none;
        animation: none;
    }
    
    .form-section {
        box-shadow: none;
        transform: none;
        transition: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .assessment-table,
    .summary-table {
        page-break-inside: avoid;
        box-shadow: none;
        width: 100%;
    }
    
    .signature-box {
        box-shadow: none;
        break-inside: avoid;
    }
    
    @page {
        margin: 1.5cm;
        size: A4;
    }
    
    .rating-option.selected {
        background-color: #e6e6e6 !important;
        color: black !important;
        font-weight: bold !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        transform: none;
        box-shadow: none;
        border: 1px solid #666;
    }
    
    .assessment-table th,
    .summary-table th {
        background-color: #f0f0f0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border: 1px solid #666;
    }
    
    .assessment-table td,
    .summary-table td {
        border: 1px solid #999;
    }
    
    h1,
    h2,
    h3,
    .form-title,
    .form-section-title {
        color: black !important;
    }
    
    /* Avoid page breaks inside sections */
    .form-group {
        page-break-inside: avoid;
    }
    
    /* Force page breaks between major sections */
    h2 {
        page-break-before: always;
    }
    
    h2:first-of-type {
        page-break-before: avoid;
    }
}

/* เพิ่มสไตล์สำหรับ textarea ของความเห็นเพิ่มเติม */
#evaluator-comment {
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: white;
    font-size: 1rem;
    font-family: 'Sarabun', sans-serif;
    resize: vertical;
    min-height: 120px;
    transition: var(--transition);
    outline: none;
    color: var(--dark);
    line-height: 1.6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03) inset;
}

#evaluator-comment:focus {
    border-color: var(--public-primary);
    box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.1);
}

#evaluator-comment::placeholder {
    color: #adb5bd;
    opacity: 0.8;
}

/* ปรับแต่งส่วนความเห็นเพิ่มเติมให้โดดเด่นขึ้น */
#summary .form-section:last-of-type {
    background-color: #f8fcff;
    border-left: 3px solid var(--public-secondary);
}

#summary .form-section:last-of-type .form-section-title {
    color: var(--public-secondary);
    font-size: 1.15rem;
    border-bottom: 1px dashed rgba(56, 163, 165, 0.3);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.evaluation-round-section {
    margin-bottom: 1rem;
}

.evaluation-round-container {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.round-option {
    flex: 1;
    position: relative;
}

.round-radio-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.round-radio-label {
    display: block;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden;
}

.round-label-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.round-number {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.round-period {
    font-size: 0.875rem;
    color: #666;
    transition: color 0.3s ease;
}

.round-radio-label::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: transparent;
    transition: all 0.3s ease;
    transform: rotate(45deg);
    z-index: 1;
}

.round-radio-input:checked + .round-radio-label {
    border-color: #3498db;
    background-color: #e8f4fd;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.1);
}

.round-radio-input:checked + .round-radio-label::before {
    background-color: #3498db;
    opacity: 0.1;
}

.round-radio-input:checked + .round-radio-label .round-number {
    color: #2980b9;
}

.round-radio-input:checked + .round-radio-label .round-period {
    color: #2c3e50;
}

.round-radio-input:hover + .round-radio-label {
    border-color: #3498db;
}

@media (max-width: 600px) {
    .evaluation-round-container {
        flex-direction: column;
    }
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: var(--public-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-user:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.user-name, 
.btn-user .fa-chevron-down {
    display: none; /* ซ่อนชื่อผู้ใช้และไอคอน dropdown */
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--dark);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.dropdown-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 5px 0;
}

.logout-item {
    color: var(--danger);
}

.logout-item:hover {
    background-color: rgba(249, 65, 68, 0.05);
}