/* Global Styles */
:root {
    --primary-color: #2563EB;
    /* Corporate Blue - Professional & Trustworthy */
    --primary-dark: #1d4ed8;
    --primary-hover: #3b82f6;
    --primary-light: #dbeafe;
    --accent-color: #2563EB;
    /* Consistent brand blue */
    --bg-color: #f8fafc;
    /* Clean, subtle gray */
    --card-bg: #ffffff;
    --text-main: #1e293b;
    /* Professional dark slate */
    --text-muted: #64748b;
    /* Balanced gray for secondary text */
    --border-color: #e2e8f0;
    /* Soft border */
    --success-color: #10b981;
    /* Modern green */
    --danger-color: #ef4444;
    /* Clear red */
    --warning-color: #f59e0b;
    /* Amber */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(37, 99, 235, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(37, 99, 235, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-heading: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #dbeafe 0%, #f8fafc 50%, #e0e7ff 100%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a.opc-platform{
    font-size:26px; /* 可依需求調整為 14px, 18px, 或 1.2rem */
    text-decoration: none;
}
@media screen and (max-width:768px){
    a.opc-platform{
        font-size:17px
    }
}
/* Header Styles */
.header {
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    height: 72px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 2px 16px rgba(37, 99, 235, 0.25);
    box-sizing: border-box;
    z-index: 1000;
}

.nycu-logo-placeholder {
    /* background-color: var(--primary-color); */
    color: white;
    padding: 6px 12px;
    font-weight: 800;
    font-size:26px;
    border-radius: 4px;
    letter-spacing: 1px;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); */
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    letter-spacing: 0.5px;
}

.header h1 a {
    color: white;
}

.siteLang {
    display: flex;
    align-items: center;
    gap: 15px;
}

.siteLang-logo {
    font-size: 20px;
}

.siteLang-line {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.3);
}

.siteLang-option {
    display: flex;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 3px;
}

.siteLang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.siteLang-btn.active,
.siteLang-btn:hover {
    background-color: white;
    color: #2563EB;
    font-weight: 600;
}

/* Layout Containers */
#choice-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 80px;
    /* Space for header */
}

.container {
    text-align: center;
    padding: 30px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    /* Ensure centering */
    box-sizing: border-box;
    animation: fadeIn 0.5s ease-out;
}

/* Business Style Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 25px;
    transition: color 0.2s;
    float: left;
    width: 100%;
    clear: both;
    /* Ensure it stays at top */
}

.back-link:hover {
    color: #2563EB;
}

.back-link span {
    margin-right: 5px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 40px;
    text-align: left;
    margin-bottom: 40px;
    max-width: 1200px;
    /* Wider for tables */
    margin-left: auto;
    margin-right: auto;
}

/* Typography Headings */
.welcome-text {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.text-2 {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 48px;
    font-weight: 400;
}

/* Choice Cards */
.choice-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.choice-card {
    background-color: white;
    width: 260px;
    height: 240px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563EB 0%, #3b82f6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.choice-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.15), 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-light);
}

.choice-card:hover::before {
    opacity: 1;
}

.choice-card:active {
    transform: translateY(-2px) scale(0.99);
    box-shadow: var(--shadow-md);
    transition: all 0.1s;
}

.choice-icon {
    font-size: 56px;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.choice-icon img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.choice-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.coming-soon {
    color: #9aa5b1;
    font-size: 12px;
    display: block;
    margin-top: 8px;
    font-weight: 400;
}

.coming-soon-badge {
    color: #9aa5b1;
    font-size: 11px;
    display: block;
    margin-top: 8px;
    font-weight: 500;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 12px;
}

.coming-soon-card {
    position: relative;
}

/* Config Calibration Section (at top) */
.config-calibration-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.config-calibration-section .section-label {
    text-align: center;
    margin-bottom: 20px;
}

.config-calibration-section .choice-cards {
    justify-content: center;
}

/* Config Extra Section (for future additions) */
.config-extra-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.config-extra-section .section-label {
    text-align: center;
    margin-bottom: 20px;
}

.config-extra-section .choice-cards {
    justify-content: center;
}

/* Logout Section */
.logout-section {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.logout-card {
    width: 140px;
    height: 100px;
    background-color: #fff5f5;
    border-color: #ffdce0;
    box-shadow: none;
}

.logout-card:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.logout-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: #e53e3e;
}

.logout-title {
    color: #c53030;
    font-size: 16px;
}

/* Login Page Styles */
.login-container {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 30px;
}

.login-box {
    background-color: white;
    padding: 50px 70px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    border: none;
}

.register-box {
    max-width: 520px;
}

.register-box .form-row {
    display: flex;
    gap: 20px;
}

.register-box .form-row .col-half {
    flex: 1;
}

.field-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: -6px 0 10px 0;
    font-weight: 400;
}

.login-title {
    text-align: center;
    color: #2563EB;
    font-size: 26px;
    margin-bottom: 36px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    background-color: #fff;
    color: var(--text-main);
}

.form-control:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

.form-actions {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.form-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.form-links a {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.form-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.form-links span {
    color: #cbd5e1;
    font-size: 14px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background-color: rgba(255, 59, 48, 0.1);
    /* Soft Red */
    color: var(--danger-color);
    border: 1px solid transparent;
    /* No border for cleaner look */
    font-weight: 600;
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    border-color: var(--danger-color);
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Footer & Acknowledgments */
.acknowledgment {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.acknowledgment_1 {
    color: #999;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
}

.nstc-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    /* background: var(--bg-color); */
    border-radius: var(--radius-md);
}

.nstc-logo-container img {
    height: 40px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.nstc-logo-container img:hover {
    opacity: 1;
}

/* Sub-page Navigation */
.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.back-btn {
    color: var(--text-muted);
    margin-right: 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background-color: #f8f9fa;
    transition: all 0.2s;
}

.back-btn:hover {
    color: #2563EB;
    background-color: #dbeafe;
}

.page-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 26px;
    font-weight: 500;
}

/* Forms (Config) */
.config-form-container {
    background-color: #fbfbfc;
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.col-half {
    flex: 1;
}

.form-actions-right {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

/* Tables */
.config-table-container h3,
.job-status-section h3 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 3px solid #2563EB;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f1f3f5;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s;
}

.btn-sm:hover {
    opacity: 0.9;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-failed {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.status-running {
    background-color: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: white;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #2563EB;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    margin-bottom: 30px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}

/* --- Responsive Design & Utils --- */
.page-offset {
    margin-top: 80px !important;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-left: 4px solid #2563EB;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: toastSlideIn 0.3s cubic-bezier(0.2, 1, 0.3, 1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    border-color: var(--success-color);
}

.toast-error {
    border-color: var(--danger-color);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Emoji Icons */
.choice-icon.emoji-icon {
    font-size: 52px;
    text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease;
}

.choice-card:hover .emoji-icon {
    transform: scale(1.08);
}

/* Choice Title Enhancement */
.choice-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 0.2px;
}

/* ==========================================
   SUB-PAGE STYLES (Correction, Utilities, etc.)
   ========================================== */

/* Sub-page Hero Section */
.sub-page-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    padding: 40px 0 50px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.sub-page-hero .container {
    padding-top: 0;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumb a {
    color: #2563EB;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #1d4ed8;
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-muted);
}

/* Sub-page Title Section */
.sub-page-title {
    text-align: center;
}

.sub-page-title h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.sub-page-title p {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
}

/* Sub-page Content Section */
.sub-page-content {
    padding: 0 30px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Section Label */
.section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Styled Job Status Section */
.job-status-card {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    margin-top: 48px;
}

.job-status-card h3 {
    font-size: 18px;
    color: var(--text-main);
    margin: 0 0 24px 0;
    padding-left: 12px;
    border-left: 3px solid #2563EB;
    font-weight: 600;
}

/* Empty State for Tables */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
}

/* ==========================================
   OPC FORM STYLES (Curvilinear OPC Page)
   Clean, Formal Design
   ========================================== */

/* Page Layout */
.opc-page {
    min-height: 100vh;
    background-color: var(--bg-color);
    padding: 40px 20px;
}

.opc-container {
    max-width: 720px;
    margin: 0 auto;
}

/* Back Link */
.opc-back-link {
    display: inline-block;
    color: #2563EB;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.opc-back-link:hover {
    color: #1d4ed8;
}

/* Main Card */
.opc-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 40px 48px;
}

/* Header */
.opc-header {
    margin-bottom: 32px;
}

.opc-welcome {
    font-size: 18px;
    color: #2563EB;
    margin: 0 0 8px 0;
}

.opc-welcome .user-name {
    font-weight: 600;
}

.opc-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.opc-title .task-name {
    color: #ea580c;
}

/* Form Fields */
.opc-field {
    margin-bottom: 20px;
}

.opc-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.opc-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #fff;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.opc-input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.opc-input::placeholder {
    color: #ef4444;
}

.opc-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* File Upload */
.opc-file-row {
    display: flex;
    gap: 12px;
}

.opc-file-display {
    flex: 1;
    background-color: #f9fafb;
}

.opc-file-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: #4b5563;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.opc-file-btn:hover {
    background-color: #374151;
}

/* Panel Buttons */
.opc-panel {
    margin: 20px 0;
}

.opc-panel-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.opc-panel-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563EB 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.opc-panel-btn.active {
    border-radius: 8px 8px 0 0;
}

.opc-panel-btn-secondary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.opc-panel-btn-secondary:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.panel-btn-icon {
    font-size: 18px;
}

.panel-btn-text {
    flex: 1;
    text-align: left;
}

.panel-btn-status {
    font-size: 13px;
    opacity: 0.8;
}

.panel-btn-status.has-selection {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.panel-btn-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

/* Panel Content */
.opc-panel-content {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    transition: max-height 0.3s ease;
}

.opc-panel-content.open {
    max-height: 400px;
    overflow-y: auto;
}

/* Config List */
.config-list {
    padding: 8px;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.config-item:hover {
    background-color: #e2e8f0;
}

.config-item.active {
    background-color: #dbeafe;
}

.config-item-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.config-item.active .config-item-radio {
    border-color: #2563EB;
}

.config-item.active .config-item-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: #2563EB;
    border-radius: 50%;
}

.config-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.config-item-detail {
    font-size: 12px;
    color: #64748b;
}

/* Parameters Section */
.opc-params-section {
    margin: 24px 0;
}

.params-grid {
    display: grid;
    gap: 16px;
}

/* Read-only Parameters Table */
.params-readonly {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
}

.params-table tr:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.params-table td {
    padding: 12px 0;
}

.param-key {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    width: 120px;
}

.param-value {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 600;
}

/* Readonly Header */
.readonly-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.readonly-icon {
    font-size: 18px;
}

.readonly-title {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.readonly-name {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 16px;
}

.readonly-note {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: #94a3b8;
}

.readonly-note a {
    color: var(--primary-color);
    font-weight: 500;
}

.readonly-note a:hover {
    text-decoration: underline;
}

/* Advanced Parameters Grid */
.advanced-params-grid {
    padding: 20px;
    display: grid;
    gap: 16px;
}

/* Action Buttons */
.opc-actions {
    display: flex;
    gap: 16px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.opc-btn {
    flex: 1;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.opc-btn-reset {
    background-color: #f97316;
    color: white;
}

.opc-btn-reset:hover {
    background-color: #ea580c;
}

.opc-btn-submit {
    background-color: #2563EB;
    color: white;
}

.opc-btn-submit:hover {
    background-color: #1d4ed8;
}

/* Footer */
.opc-footer {
    margin-top: 48px;
    text-align: center;
}

.opc-footer-text {
    font-size: 13px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
}

.opc-footer-logo img {
    height: 36px;
    opacity: 0.8;
}

/* ==========================================
   FORM SECTION STYLES (Litho, MRC Pages)
   ========================================== */

/* Form Section */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 16px 0;
    padding-left: 12px;
    border-left: 3px solid var(--primary-color);
}

.section-note {
    font-size: 13px;
    color: #ef4444;
    margin: 0 0 20px 0;
    padding: 10px 14px;
    background-color: #fef2f2;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

/* Region Selector */
.region-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.region-status {
    flex: 1;
    margin: 0;
    font-size: 14px;
    color: var(--text-main);
}

.region-status span {
    font-weight: 600;
    color: var(--primary-color);
}

.region-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.region-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563EB 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.region-btn:active {
    transform: translateY(0);
}

/* ==========================================
   JOB STATUS & DETAIL STYLES
   ========================================== */

/* Detail Modal Content */
.detail-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Table Row Hover Effect for Jobs */
#job-status-body tr {
    transition: background-color 0.15s ease;
}

#job-status-body tr:hover {
    background-color: #f8fafc;
}

/* Error Message Box in Modal */
.error-message-box {
    margin-top: 16px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
}

.error-message-box pre {
    margin: 0;
    font-size: 13px;
    color: #7f1d1d;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
}

/* Progress Bar */
.progress-bar-container {
    margin-top: 10px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-container > div {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #3b82f6);
    transition: width 0.3s ease;
}

/* ==========================================
   ENHANCED RESPONSIVE DESIGN
   ========================================== */

/* Job Status Table - Improved Layout */
.job-status-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    min-width: 700px;
}

.data-table th,
.data-table td {
    white-space: nowrap;
    padding: 12px 16px;
}

/* Modal - Improved Layout */
.modal {
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 16px;
}

.detail-row:last-child {
    border-bottom: none;
}

/* Litho Params Grid in Modal - 2 columns on desktop */
.litho-params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
}

.litho-params-grid .detail-row {
    padding: 8px 0;
}

/* ==========================================
   TABLET BREAKPOINT (max-width: 992px)
   ========================================== */
@media (max-width: 992px) {
    .opc-card {
        padding: 32px;
    }

    .modal {
        max-width: 90%;
        padding: 32px;
    }

    .litho-params-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ==========================================
   MOBILE BREAKPOINT (max-width: 768px)
   ========================================== */
@media (max-width: 768px) {
    /* Header */
    .header {
        padding: 0 15px;
        height: 64px;
    }

    .header h1 {
        position: static;
        transform: none;
        font-size: 16px;
        flex: 1;
        text-align: center;
        margin: 0 10px;
    }

    .nycu-logo-placeholder {
        font-size: 12px;
        padding: 4px 8px;
    }

    .siteLang {
        gap: 8px;
    }

    .siteLang-logo {
        font-size: 16px;
    }

    .siteLang-line {
        display: none;
    }

    .siteLang-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Page offset for fixed header */
    .page-offset {
        margin-top: 72px !important;
    }

    #choice-page {
        padding-top: 72px;
    }

    /* Container & Content */
    .container {
        padding: 20px 15px;
    }

    .sub-page-content {
        padding: 0 15px;
    }

    .sub-page-hero {
        padding: 24px 0 32px;
    }

    /* Typography */
    .welcome-text {
        font-size: 24px;
    }

    .text-2 {
        font-size: 14px;
        margin-bottom: 32px;
    }

    .sub-page-title h2 {
        font-size: 22px;
    }

    .sub-page-title p {
        font-size: 14px;
    }

    /* Choice Cards */
    .choice-cards {
        gap: 16px;
    }

    .choice-card {
        width: 100%;
        max-width: 280px;
        height: 180px;
    }

    .choice-icon {
        font-size: 42px;
        margin-bottom: 12px;
    }

    .choice-icon img {
        max-height: 80px;
    }

    .choice-title {
        font-size: 16px;
    }

    /* Logout Section */
    .logout-section {
        margin-top: 24px;
        padding-top: 24px;
    }

    .logout-card {
        width: 120px;
        height: 80px;
    }

    .logout-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .logout-title {
        font-size: 14px;
    }

    /* Form Styles */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .config-form-container {
        padding: 20px;
    }

    .form-actions-right {
        flex-direction: column;
        gap: 12px;
    }

    .form-actions-right .btn {
        width: 100%;
    }

    /* Job Status Card */
    .job-status-card {
        padding: 20px;
        margin-top: 32px;
    }

    .job-status-card h3 {
        font-size: 16px;
    }

    /* Data Table - Horizontal scroll */
    .data-table {
        font-size: 13px;
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Modal */
    .modal-overlay {
        padding: 15px;
        align-items: flex-start;
        padding-top: 80px;
    }

    .modal {
        padding: 24px;
        max-width: 100%;
        margin: 0;
        max-height: calc(100vh - 100px);
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .detail-row {
        grid-template-columns: 100px 1fr;
        gap: 12px;
        padding: 10px 0;
    }

    .detail-label {
        font-size: 12px;
        width: auto;
    }

    .detail-value {
        font-size: 13px;
    }

    .litho-params-section {
        padding: 12px !important;
    }

    .litho-params-grid {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }

    .litho-params-grid .detail-row {
        padding: 6px 0;
    }

    /* OPC Form Styles */
    .opc-page {
        padding: 24px 15px;
    }

    .opc-card {
        padding: 24px 20px;
    }

    .opc-header {
        margin-bottom: 24px;
    }

    .opc-welcome {
        font-size: 16px;
    }

    .opc-title {
        font-size: 18px;
    }

    .opc-file-row {
        flex-direction: column;
        gap: 10px;
    }

    .opc-file-btn {
        width: 100%;
    }

    .opc-panel-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .panel-btn-text {
        font-size: 13px;
    }

    .panel-btn-status {
        font-size: 11px;
    }

    .opc-actions {
        flex-direction: column;
        gap: 12px;
    }

    .opc-btn {
        width: 100%;
    }

    .opc-footer {
        margin-top: 32px;
    }

    /* Region Selector */
    .region-selector {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .region-status {
        text-align: center;
    }

    .region-btn {
        width: 100%;
    }

    /* Form Sections */
    .form-section {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }

    .section-title {
        font-size: 16px;
    }

    .section-note {
        font-size: 12px;
    }

    /* Acknowledgment */
    .acknowledgment {
        margin-top: 40px;
    }

    .nstc-logo-container img {
        height: 30px;
    }

    /* Login Page */
    .login-box {
        padding: 32px 24px;
        margin: 15px;
        margin-top: 80px !important;
    }

    .register-box {
        max-width: 100%;
        margin-top: 80px !important;
    }

    .register-box .form-row {
        flex-direction: column;
        gap: 0;
    }

    .field-hint {
        font-size: 11px;
        margin: -4px 0 8px 0;
    }

    .login-footer {
        padding-bottom: 20px;
    }

    .login-title {
        font-size: 22px;
        margin-bottom: 28px;
    }

    .form-group label {
        font-size: 14px;
    }

    .form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .form-links {
        margin-top: 24px;
        padding-top: 20px;
        gap: 12px;
    }

    .form-links a {
        font-size: 13px;
    }

    .form-links span {
        font-size: 13px;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 13px;
        flex-wrap: wrap;
    }

    /* Toast */
    .toast-container {
        top: 80px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ==========================================
   SMALL MOBILE BREAKPOINT (max-width: 480px)
   ========================================== */
@media (max-width: 480px) {
    .header h1 {
        font-size: 14px;
    }

    .welcome-text {
        font-size: 20px;
    }

    .choice-card {
        height: 160px;
    }

    .choice-icon {
        font-size: 36px;
    }

    .choice-icon img {
        max-height: 60px;
    }

    .choice-title {
        font-size: 15px;
    }

    .modal {
        padding: 20px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-label {
        font-size: 11px;
        color: #94a3b8;
    }

    .detail-value {
        font-size: 14px;
        font-weight: 600;
    }

    .opc-card {
        padding: 20px 16px;
    }

    .opc-title {
        font-size: 16px;
    }

    .login-box {
        padding: 24px 20px;
        margin-top: 75px !important;
    }

    .register-box {
        margin-top: 75px !important;
    }

    .login-title {
        font-size: 20px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .field-hint {
        font-size: 10px;
    }

    .form-links {
        flex-direction: column;
        gap: 8px;
    }

    .form-links span {
        display: none;
    }

    /* Hide less important table columns on very small screens */
    .data-table {
        min-width: 500px;
    }
}
#job-status-body td{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 150px !important;
}