/* ==============================================
   VRS Portal - 統一樣式定義
   ============================================== */

/* 顏色變數定義 */
:root {
    --primary: #6B46C1;
    --primary-hover: #553C9A;
    --primary-light: #E9D8FD;
    --primary-active: #4A2F8A;

    /* 背景色 */
    --background-light: #F3F4F6;
    --background-dark: #111827;
    --surface-light: #FFFFFF;
    --surface-dark: #1F2937;

    /* 邊框色 */
    --border-light: #E5E7EB;
    --border-dark: #374151;

    /* 文字色 */
    --text-light: #1F2937;
    --text-dark: #F9FAFB;
    --text-secondary-light: #6B7280;
    --text-secondary-dark: #9CA3AF;

    /* 選單相關 */
    --menu-hover: #E0E7FF;
    --menu-text: #4B5563;

    /* 狀態色 */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
}

/* ==============================================
   按鈕樣式
   ============================================== */

/* 主要按鈕 */
.btn-primary {
    padding: 0.625rem 2rem;
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 10px 15px -3px rgba(107, 70, 193, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -5px rgba(107, 70, 193, 0.4);
}

.btn-primary:active {
    background-color: var(--primary-active);
    transform: scale(0.95);
}

.btn-primary:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    opacity: 0.5;
}

/* 次要按鈕 (外框) */
.btn-secondary {
    padding: 0.625rem 1.5rem;
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: rgba(107, 70, 193, 0.05);
}

.btn-secondary:active {
    transform: scale(0.95);
}

/* 暗色模式按鈕 */
.dark .btn-secondary {
    background-color: var(--surface-dark);
    color: var(--primary-light);
    border-color: rgba(107, 70, 193, 0.3);
}

.dark .btn-secondary:hover {
    background-color: rgba(107, 70, 193, 0.1);
}

/* 一般按鈕 (白色/灰色) */
.btn-default {
    padding: 0.5rem 1rem;
    background-color: white;
    color: var(--text-secondary-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-default:hover {
    background-color: #F9FAFB;
}

.dark .btn-default {
    background-color: var(--surface-dark);
    color: var(--text-secondary-dark);
    border-color: var(--border-dark);
}

.dark .btn-default:hover {
    background-color: #374151;
}

/* ==============================================
   選單樣式
   ============================================== */

/* 側邊選單項目 */
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    color: var(--text-secondary-light);
}

.nav-item:hover {
    background-color: var(--background-light);
    color: var(--text-light);
}

.dark .nav-item {
    color: var(--text-secondary-dark);
}

.dark .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
}

/* 選單項目 - 啟用狀態 */
.nav-item.active {
    background-color: rgba(107, 70, 193, 0.1);
    color: var(--primary);
}

.nav-item.active:hover {
    background-color: rgba(107, 70, 193, 0.15);
}

.dark .nav-item.active {
    background-color: rgba(107, 70, 193, 0.2);
    color: var(--primary-light);
}

/* 選單圖示 */
.nav-item .material-symbols-outlined {
    margin-right: 0.75rem;
    font-size: 20px;
}

/* ==============================================
   卡片樣式
   ============================================== */

.card {
    background-color: var(--surface-light);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dark .card {
    background-color: var(--surface-dark);
    border-color: var(--border-dark);
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.card-header {
    padding: 1.5rem;
    flex-grow: 1;
}

.card-footer {
    padding: 1rem;
    background-color: rgba(243, 244, 246, 0.5);
    border-top: 1px solid var(--border-light);
}

.dark .card-footer {
    background-color: rgba(31, 41, 55, 0.2);
    border-top-color: var(--border-dark);
}

/* ==============================================
   表單元件樣式
   ============================================== */

/* 輸入框基本樣式 */
.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background-color: var(--background-light);
    color: var(--text-light);
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:hover {
    border-color: #D1D5DB;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    ring: 2px;
    ring-color: rgba(107, 70, 193, 0.2);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.dark .form-input {
    background-color: var(--background-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.dark .form-input:hover {
    border-color: #4B5563;
}

/* 下拉選單 */
.form-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background-color: var(--background-light);
    color: var(--text-light);
    border: 1px solid var(--border-light);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-select:hover {
    border-color: #D1D5DB;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.dark .form-select {
    background-color: var(--background-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

/* 標籤樣式 */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary-light);
    margin-bottom: 0.25rem;
}

.dark .form-label {
    color: var(--text-secondary-dark);
}

/* 必填標記 */
.required {
    color: #EF4444;
}

/* 檔案上傳區域 */
.file-upload {
    border: 2px dashed var(--border-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--primary);
    background-color: rgba(107, 70, 193, 0.02);
}

.dark .file-upload {
    border-color: var(--border-dark);
}

.dark .file-upload:hover {
    border-color: var(--primary);
    background-color: rgba(107, 70, 193, 0.05);
}

/* ==============================================
   狀態標籤 (Badge)
   ============================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 進行中狀態 */
.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.dark .badge-success {
    background-color: rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

/* 警告狀態 */
.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.dark .badge-warning {
    background-color: rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}

/* 錯誤/未完成狀態 */
.badge-error {
    background-color: #FEE2E2;
    color: #991B1B;
}

.dark .badge-error {
    background-color: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

/* 資訊狀態 */
.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.dark .badge-info {
    background-color: rgba(59, 130, 246, 0.3);
    color: #93C5FD;
}

/* ==============================================
   進度條
   ============================================== */

.progress-bar {
    width: 100%;
    height: 0.625rem;
    background-color: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
}

.dark .progress-bar {
    background-color: #374151;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* ==============================================
   圖示按鈕
   ============================================== */

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    color: var(--text-secondary-light);
    transition: all 0.2s ease;
    cursor: pointer;
}

.icon-button:hover {
    color: var(--primary);
    background-color: rgba(107, 70, 193, 0.05);
}

.dark .icon-button {
    color: var(--text-secondary-dark);
}

.dark .icon-button:hover {
    color: var(--primary-light);
    background-color: rgba(107, 70, 193, 0.1);
}

/* ==============================================
   分隔線
   ============================================== */

.divider {
    border-top: 1px solid var(--border-light);
    margin: 1.5rem 0;
}

.dark .divider {
    border-top-color: var(--border-dark);
}

/* ==============================================
   步驟指示器
   ============================================== */

.step-indicator {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
}

.step-indicator-item {
    flex: 1;
    height: 0.375rem;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.step-indicator-item.active {
    background-color: white;
}

/* ==============================================
   響應式工具類
   ============================================== */

@media (max-width: 640px) {

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ==============================================
   動畫效果
   ============================================== */

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 平滑過渡 */
.transition-all {
    transition: all 0.2s ease;
}

.transition-colors {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* ==============================================
   焦點樣式
   ============================================== */

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==============================================
   載入動畫
   ============================================== */

.loading-spinner {
    border: 3px solid rgba(107, 70, 193, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==============================================
   Step 1
   ============================================== */
/* 確保上傳區域有適當間距 */
#cert-upload-area,
#logo-upload-area {
    transition: all 0.3s ease;
}

/* 上傳完成後的淡入動畫 */
#cert-completed:not(.hidden),
#logo-completed:not(.hidden) {
    animation: fadeIn 0.3s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 確保完成卡片不會太高 */
#cert-completed,
#logo-completed {
    max-height: 100px;
}

/* 確保提交按鈕區域有足夠間距 */
.pt-8.mt-8 {
    margin-top: 2rem !important;
    padding-top: 2rem !important;
}

/* 響應式調整 */
@media (max-width: 768px) {

    #cert-upload-area,
    #logo-upload-area {
        min-height: 350px !important;
        padding: 1.5rem !important;
    }
}