/* EP SPK Admissions - Main Stylesheet with Thai Font Support */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    padding: 5px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(1, 56, 184, 0.15);
}

.language-switcher a {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 15px;
    transition: all 0.3s;
    font-weight: 500;
}

.language-switcher a:hover {
    background-color: #fff3cd;
}

.language-switcher a.active {
    background: linear-gradient(135deg, #0138b8 0%, #0056d2 100%);
    color: white;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #0138b8 0%, #0056d2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(1, 56, 184, 0.3);
    border-top: 4px solid #fddf02;
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.app-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.app-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.app-header .program-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Main Content */
main {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.section {
    margin-bottom: 2rem;
}

/* Level Selection */
.level-selection {
    text-align: center;
    padding: 2rem;
}

.level-selection h3 {
    color: #0138b8;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label:hover {
    background-color: #fff8e1;
    border-color: #0138b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(1, 56, 184, 0.15);
}

.radio-label input[type="radio"]:checked + span {
    color: #0138b8;
    font-weight: 600;
}

.radio-label input[type="radio"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0138b8;
}

.radio-label span {
    font-size: 1.1rem;
    font-weight: 500;
}

.radio-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-inline label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-inline input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: #0138b8;
}

/* Form Sections */
.form-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.form-section:last-child {
    border-bottom: none;
}

.section-title {
    color: #0138b8;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #fddf02;
    display: inline-block;
    padding-right: 1rem;
}

.subsection-title {
    color: #34495e;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
    flex: 1;
}

.col-md-4 {
    flex: 0 0 calc(33.333% - 0.667rem);
}

.col-md-6 {
    flex: 0 0 calc(50% - 0.5rem);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.required {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: 'Sarabun', sans-serif;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #0138b8;
    box-shadow: 0 0 0 4px rgba(1, 56, 184, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox-label:hover {
    background-color: #fff8e1;
    transform: translateX(5px);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0138b8;
}

/* Document Upload Groups */
.document-uploads {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.document-upload-group {
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s;
}

.document-upload-group.has-files {
    border-color: #28a745;
    background-color: #f0f9f4;
}

.document-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.checkmark-icon {
    color: #28a745;
    font-size: 1.5rem;
    font-weight: bold;
    animation: checkmarkPop 0.3s ease;
}

@keyframes checkmarkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.document-label {
    flex: 1;
    cursor: pointer;
}

.document-upload {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Sarabun', sans-serif;
}

.document-upload:hover {
    border-color: #0138b8;
    background-color: #f0f7ff;
}

.document-upload:focus {
    outline: none;
    border-color: #0138b8;
    box-shadow: 0 0 0 3px rgba(1, 56, 184, 0.1);
}

.file-preview {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.85rem;
    max-width: 100%;
}

.file-preview-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-size {
    color: #666;
    font-size: 0.8rem;
}

.file-preview-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    padding: 0 0.25rem;
    font-size: 1.2rem;
    line-height: 1;
}

.file-preview-remove:hover {
    color: #a71d2a;
}

.portfolio-waiver {
    padding: 0.75rem;
    background: #fff8e1;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

/* Declaration Box */
.declaration-box {
    background: linear-gradient(135deg, #fff8e1 0%, #fffbf0 100%);
    border: 2px solid #fddf02;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(253, 223, 2, 0.2);
}

.declaration-box p {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Sarabun', sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #0138b8 0%, #0056d2 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #012e99 0%, #0046b3 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(1, 56, 184, 0.3);
}

.btn-primary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #fddf02 0%, #ffd000 100%);
    color: #2c3e50;
    font-weight: 700;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e4c902 0%, #e6b800 100%);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #fddf02;
}

/* Alerts */
.alert {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-warning {
    background-color: #fff8e1;
    border-left-color: #fddf02;
    color: #2c3e50;
}

.alert-info {
    background-color: #e3f2fd;
    border-left-color: #0138b8;
    color: #2c3e50;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert h3 {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 3px solid #fddf02;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 0.9rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

/* Announcement Box */
.announcement-box {
    display: flex;
    gap: 1.5rem;
    background: linear-gradient(135deg, #fddf02 0%, #ffd000 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(253, 223, 2, 0.3);
    border: 2px solid #ffd000;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.announcement-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.announcement-content {
    flex: 1;
}

.announcement-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.announcement-text {
    color: #2c3e50;
    line-height: 1.6;
    font-size: 1rem;
}

.announcement-text p {
    margin: 0.5rem 0;
}

.announcement-text ul, .announcement-text ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.announcement-text a {
    color: #0138b8;
    font-weight: 600;
    text-decoration: underline;
}

.announcement-text a:hover {
    color: #0056d2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .app-header h2 {
        font-size: 1.2rem;
    }
    
    .app-header h3 {
        font-size: 1.1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        flex: 1 1 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .language-switcher {
        top: 10px;
        right: 10px;
    }
}

/* Notification animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Photo Preview Styles */
#photo-preview {
    margin-top: 10px;
    text-align: center;
}

#photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#photo-preview p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0138b8;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 0.9rem;
    color: #666;
}

.loading-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0138b8, #0056d2, #0138b8);
    background-size: 200% 100%;
    animation: loading-animation 1.5s ease-in-out infinite;
}

@keyframes loading-animation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
