/* 預約系統主樣式 */
.booking-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 36px;
    color: #2e3091;
    font-weight: normal;
    margin-bottom: 15px;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    /* -webkit-background-clip: text; */
    /* -webkit-text-fill-color: transparent;*/
}

.page-header .subtitle {
    color: #666;
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 步驟指示器 */
.booking-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    position: relative;
}

.booking-steps:before {
    content: '';
    position: absolute;
    top: 25px;
    left: 50px;
    right: 50px;
    height: 3px;
    background: #e0e0e0;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 20px;
    font-weight: bold;
    color: #999;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.step-item.completed .step-number {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.step-title {
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.step-item.active .step-title {
    color: #667eea;
}

.step-item.completed .step-title {
    color: #4CAF50;
}

.step-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

/* 內容區域 */
.booking-content {
    /*background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 40px;
    border-radius: 15px;*/
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: #667eea;
}

/* 顧問網格 */
.consultant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.consultant-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #eee;
    position: relative;
}

.consultant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.consultant-card.selected {
    border: 2px solid #667eea;
    box-shadow: 0 5px 25px rgba(102, 126, 234, 0.4);
}

.consultant-card.selected:before {
    content: '✓ 已選擇';
    position: absolute;
    top: -12px;
    right: 15px;
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.consultant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    color: white;
    text-align: center;
    position: relative;
}

.consultant-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    margin: 0 auto 15px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
}

.consultant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.consultant-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 50%;
    z-index: 1;
}

.consultant-avatar img.loaded + .consultant-avatar::before {
    display: none;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.consultant-name {
    font-size: 20px;
    margin-bottom: 5px;
    color: #ffffff;
}

.consultant-title {
    font-size: 14px;
    opacity: 0.9;
    color: #ffffff;
}

.consultant-body {
    padding: 25px;
}

.consultant-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    color: #555;
}

.info-icon {
    color: #667eea;
    margin-right: 10px;
    min-width: 20px;
    text-align: center;
}

.expertise-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.expertise-tag {
    background: #eef2ff;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.consultant-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-select {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.btn-select:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-select:active {
    transform: translateY(0);
}

.btn-select.need-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-select.need-login:after {
    content: '🔒';
    margin-left: 8px;
    font-size: 14px;
}

.icon-user-check {
    color: #fff;
}

/* 時間選擇區域 */
.time-selection {
    display: none;
    background-color: #fff;
    padding: 40px;
}

.time-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.week-display {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.btn-nav {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: #333;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
}

.day-cell {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    position: relative;
}

.day-cell:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.day-cell.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.day-cell.disabled:hover {
    border-color: #eee;
    background: #f5f5f5;
}

.day-cell.selected {
    border-color: #4CAF50;
    background: #f0fff4;
}

.day-cell.today {
    background: #e3f2fd;
}

.day-cell.today .day-number {
    color: #1976d2;
}

.day-number {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.day-cell.disabled .day-number {
    color: #ccc;
}

.day-cell.selected .day-number {
    color: #4CAF50;
}

.day-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.availability {
    font-size: 11px;
    color: #28a745;
    background: #e8f5e9;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 5px;
    display: inline-block;
}

/* 時間段選擇 */
.time-slot-container {
    display: none;
    animation: fadeIn 0.5s ease;
}

.selected-date {
    font-size: 20px;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.selected-date span {
    color: #667eea;
}

.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.time-slot {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-slot:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.time-slot.selected {
    border-color: #4CAF50;
    background: #f0fff4;
    color: #155724;
}

.time-slot.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.time-slot.disabled:hover {
    border-color: #e0e0e0;
    background: #f5f5f5;
    transform: none;
}

.time-slot.available:hover {
    background: #e8f5e9;
    border-color: #28a745;
}

.time-display {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.slot-status {
    font-size: 12px;
    color: #666;
}

.available .slot-status {
    color: #28a745;
}

.booked .slot-status {
    color: #dc3545;
}

/* 表單區域 */
.booking-form-container {
    display: none;
    background-color: #fff;
    padding: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group .required {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* 信息提示框 */
.info-box {
    background: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.info-box h4 {
    color: #2196F3;
    margin-bottom: 10px;
}

/* 預約摘要 */
.booking-summary {
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.summary-title {
    color: #155724;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: bold;
    color: #155724;
}

.summary-label {
    color: #666;
}

.summary-value {
    color: #333;
    font-weight: 500;
}

/* 表單操作按鈕 */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-prev {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-prev:hover {
    background: #5a6268;
}

.btn-next {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-next:hover {
    background: #5a67d8;
}

.btn-next:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-submit {
    background: #2e3091;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-submit>span{
    color: #fff;
}
.btn-submit:hover {
    background: #45a049;
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-submit i {
    color: #ffffff;
}

.icon-spinner {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功頁面 */
.booking-success {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 40px;
    color: white;
}

.success-title {
    font-size: 28px;
    color: #155724;
    margin-bottom: 15px;
}

.success-message {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.confirmation-details {
    background: #f0fff4;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.confirmation-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #c3e6cb;
}

.confirmation-item:last-child {
    border-bottom: none;
}

.confirmation-label {
    color: #666;
    font-weight: 500;
}

.confirmation-value {
    color: #333;
    font-weight: 600;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-print {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-print:hover {
    background: #0b7dda;
}

.btn-calendar {
    background: #FF9800;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-calendar:hover {
    background: #e68900;
}

.btn-dashboard {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-dashboard:hover {
    background: #45a049;
}

/* 加載指示器 */
.loader {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader p {
    margin: 10px 0;
    color: #666;
}

/* 登錄提示 */
#loginPrompt {
    display: none;
    background: #fff3cd;
    color: #856404;
    padding: 12px 20px;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#loginPrompt a {
    color: #856404;
    text-decoration: underline;
    font-weight: 600;
}

#loginPrompt a:hover {
    color: #333;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1/-1;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    color: #666;
    line-height: 1.6;
}

/* 自定義提示 */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    animation: fadeIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-alert.success {
    background: #4CAF50;
    color: white;
}

.custom-alert.error {
    background: #dc3545;
    color: white;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 登錄彈窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header .close {
    font-size: 28px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.modal-header .close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 30px;
}

.login-prompt {
    text-align: center;
    margin-bottom: 30px;
}

.login-prompt i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 20px;
    display: block;
}

.login-prompt h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.login-prompt p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.login-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.btn-login, .btn-register {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 150px;
    justify-content: center;
}

.btn-login {
    background: #667eea;
    color: white;
}

.btn-login:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-register {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-register:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-tip {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.login-benefits {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    text-align: left;
}

.login-benefits li {
    padding: 8px 0;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.login-benefits li i {
    color: #4CAF50;
}

/* 測試按鈕（開發時使用） */
.test-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .consultant-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .booking-container {
        margin: 20px auto;
        padding: 15px;
    }

    .booking-steps {
        flex-wrap: wrap;
        gap: 20px;
    }

    .booking-steps:before {
        display: none;
    }

    .step-item {
        flex: none;
        width: 45%;
        margin-bottom: 20px;
    }

    .booking-content {
        padding: 25px;
    }

    .consultant-grid {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .time-slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        gap: 15px;
    }

    .btn-prev, .btn-next, .btn-submit {
        width: 100%;
        justify-content: center;
    }

    .success-actions {
        flex-direction: column;
    }

    .success-actions button,
    .success-actions a {
        width: 100%;
        margin-bottom: 10px;
    }

    .login-options {
        flex-direction: column;
    }

    .btn-login, .btn-register {
        /*width: 100%;*/
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .time-slot-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .section-title {
        font-size: 20px;
    }
}