/* 全域 CSS 樣式 */

/* 自定義 CSS 變數（對應原本的 Tailwind 主題色彩） */
:root {
  --color-primary: #3b82f6;
  --color-secondary: #6b7280;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #06b6d4;
}
/* 通用文字輸入框樣式 - 適用於所有輸入框 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
textarea,
select {
    width: 100%;
    padding: 6px 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    color: #374151;
    background-color: white;
    box-sizing: border-box;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* 焦點狀態 */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #f0f9ff;
}

/* 錯誤狀態 */
input[type="text"].error,
input[type="password"].error,
input[type="email"].error,
input[type="number"].error,
input[type="tel"].error,
input[type="url"].error,
input[type="search"].error,
input[type="date"].error,
input[type="datetime-local"].error,
input[type="time"].error,
input[type="month"].error,
input[type="week"].error,
textarea.error,
select.error {
    border-color: #fca5a5;
    background-color: #fef2f2;
}

input[type="text"].error:focus,
input[type="password"].error:focus,
input[type="email"].error:focus,
input[type="number"].error:focus,
input[type="tel"].error:focus,
input[type="url"].error:focus,
input[type="search"].error:focus,
input[type="date"].error:focus,
input[type="datetime-local"].error:focus,
input[type="time"].error:focus,
input[type="month"].error:focus,
input[type="week"].error:focus,
textarea.error:focus,
select.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    background-color: white;
}

/* 成功狀態 */
input[type="text"].success,
input[type="password"].success,
input[type="email"].success,
input[type="number"].success,
input[type="tel"].success,
input[type="url"].success,
input[type="search"].success,
input[type="date"].success,
input[type="datetime-local"].success,
input[type="time"].success,
input[type="month"].success,
input[type="week"].success,
textarea.success,
select.success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* 禁用狀態 */
input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="email"]:disabled,
input[type="number"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled,
input[type="search"]:disabled,
input[type="date"]:disabled,
input[type="datetime-local"]:disabled,
input[type="time"]:disabled,
input[type="month"]:disabled,
input[type="week"]:disabled,
textarea:disabled,
select:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 佔位符樣式 */
input::placeholder,
textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* 文字區域特殊樣式 */
textarea {
    resize: vertical;
    min-height: 100px;
}

/* 搜尋框特殊樣式 */
input[type="search"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3e%3c/svg%3e");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-left: 40px;
}

/* 數字輸入框特殊樣式 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 登入表單特殊樣式 */
.login-form input[type="text"], 
.login-form input[type="password"] {
    padding: 12px 12px 12px 12px; /* 為圖示預留空間 */
}

/* 表單控制項樣式 */
.form-control {
    width: 100%;
    padding: 6px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-control.success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.form-control:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* 按鈕樣式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 圖片相關樣式 */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.img-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.img-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.img-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 圖片載入動畫 */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 響應式圖片 */
@media (max-width: 768px) {
    .img-logo {
        width: 48px;
        height: 48px;
    }
    
    .img-avatar {
        width: 32px;
        height: 32px;
    }
    
    .img-thumbnail {
        width: 80px;
        height: 80px;
    }
}

/* 圖片錯誤處理 */
.img-error {
    background-color: #f3f4f6;
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
}

/* 卡片樣式 */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 響應式設計 */
@media (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"],
    input[type="month"],
    input[type="week"],
    textarea,
    select {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}




