/* ================================
   Blink | 瞬睫管家 系統 - 平板專用樣式
   ================================ */

/* 平板頁面容器 */
.tablet-page {
    max-width: 1024px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page, #f8f9fa);
}

/* 平板導航 */
.tablet-nav {
    background: linear-gradient(135deg, var(--theme-primary, #667eea) 0%, var(--theme-secondary, #764ba2) 100%);
    color: white;
    padding: 20px 32px;
    box-shadow: 0 8px 32px var(--theme-shadow-color, rgba(102, 126, 234, 0.3));
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 主題切換按鈕 */
.theme-toggle-btn {
    padding: 12px 14px !important;
}

.theme-toggle-btn span {
    font-size: 18px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    min-height: 48px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: scale(0.98);
}

/* 平板內容區域 */
.tablet-content {
    flex: 1;
    padding: 32px;
}

/* 平板按鈕樣式 */
.tablet-btn {
    min-height: 56px;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.tablet-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    z-index: 1;
}

.tablet-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tablet-btn-primary {
    background: linear-gradient(135deg, var(--brand-primary-color, #667eea) 0%, var(--brand-secondary-color, #764ba2) 100%);
    color: white;
}

.tablet-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.tablet-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.tablet-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.tablet-btn-secondary {
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #4a5568);
    border: 2px solid var(--color-border, #e2e8f0);
}

.tablet-btn-full {
    width: 100%;
}

/* 大按鈕樣式（用於主頁功能按鈕） - 依據 iPad Pro 橫向設計規範 */
.big-btn {
    min-height: 120px;
    padding: 32px 40px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transform: translateZ(0);
}

/* 漸層光澤層 */
.big-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    z-index: 1;
    pointer-events: none;
}

.big-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.big-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 2;
}

.btn-text {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.btn-desc {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

/* 平板卡片樣式 */
.tablet-card {
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #1f2937);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 24px var(--color-shadow, rgba(0, 0, 0, 0.08));
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.tablet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

/* 平板表單元素 */
.tablet-input {
    width: 100%;
    min-height: 56px;
    padding: 16px 20px;
    border: 3px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    font-size: 18px;
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #1f2937);
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.tablet-input:focus {
    outline: none;
    border-color: var(--brand-primary-color, #667eea);
    box-shadow: 0 0 0 4px var(--brand-primary-light, rgba(102, 126, 234, 0.1));
    background: var(--color-bg-card, #fafafa);
}

.tablet-select {
    width: 100%;
    min-height: 56px;
    padding: 16px 20px;
    border: 3px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    font-size: 18px;
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #1f2937);
    cursor: pointer;
    margin-bottom: 16px;
}

.tablet-select:focus {
    outline: none;
    border-color: var(--brand-primary-color, #667eea);
    box-shadow: 0 0 0 4px var(--brand-primary-light, rgba(102, 126, 234, 0.1));
}

.tablet-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px 20px;
    border: 3px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    font-size: 18px;
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #1f2937);
    resize: vertical;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.tablet-textarea:focus {
    outline: none;
    border-color: var(--brand-primary-color, #667eea);
    box-shadow: 0 0 0 4px var(--brand-primary-light, rgba(102, 126, 234, 0.1));
    background: var(--color-bg-card, #fafafa);
}

/* 平板網格系統 */
.tablet-grid {
    display: grid;
    gap: 20px;
}

.tablet-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tablet-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tablet-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 平板載入動畫 */
.tablet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-secondary, #6b7280);
    font-size: 18px;
}

.tablet-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border, #e5e7eb);
    border-top: 4px solid var(--brand-primary-color, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* 平板通知樣式 */
.tablet-alert {
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tablet-alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #10b981;
}

.tablet-alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #ef4444;
}

.tablet-alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    border: 2px solid #f59e0b;
}

.tablet-alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 2px solid #3b82f6;
}

/* 平板模態框 */
.tablet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.tablet-modal-content {
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #1f2937);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--color-shadow, rgba(0, 0, 0, 0.3));
}

.tablet-modal-header {
    padding: 24px;
    border-bottom: 2px solid var(--color-border, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tablet-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary, #1f2937);
}

.tablet-modal-body {
    padding: 24px;
}

.tablet-modal-footer {
    padding: 24px;
    border-top: 2px solid var(--color-border, #e5e7eb);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 觸控反饋 */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.6s ease-out;
}

/* 平板工具提示 */
.tablet-tooltip {
    position: relative;
    cursor: help;
}

.tablet-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

.tablet-tooltip:hover::after {
    opacity: 1;
}

/* 狀態卡片 */
.status-card {
    padding: 20px;
    border-radius: 16px;
    background: var(--color-bg-card, white);
    color: var(--color-text-primary, #1f2937);
    box-shadow: 0 4px 12px var(--color-shadow, rgba(0, 0, 0, 0.08));
    border-left: 6px solid;
}

.status-number {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.status-label {
    font-size: 16px;
    color: var(--color-text-secondary, #6b7280);
}

/* 功能網格 - 依據設計規範（平板直立模式：2欄，iPad Pro 橫向：4欄） */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

/* 管理網格 - 依據設計規範（平板直立模式：3欄，iPad Pro 橫向：4欄） */
.management-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 管理頁面標題區域 */
.management-header {
    background: var(--color-bg-card, white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px var(--color-shadow, rgba(0, 0, 0, 0.05));
}

.management-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary, #1f2937);
    margin-bottom: 8px;
}

.management-header p {
    font-size: 16px;
    color: var(--color-text-secondary, #6b7280);
}

/* 主內容區域 - 依據設計規範 */
.main-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* 空白狀態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary, #6b7280);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-primary, #374151);
}

.empty-state-description {
    font-size: 16px;
    color: var(--color-text-secondary, #6b7280);
}

/* tablet_dashboard.html 專用樣式 - 依據 iPad Pro 橫向設計規範 */
.tablet-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-page, #f8f9fa);
}

.tablet-header {
    background: linear-gradient(135deg, var(--brand-primary-color, #667eea) 0%, var(--brand-secondary-color, #764ba2) 100%);
    color: white;
    padding: 24px 32px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-title {
    font-size: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.current-time {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.95;
}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.logout-btn:active {
    transform: scale(0.98);
}

/* ================================
   大按鈕顏色變體 - 依據 iPad Pro 設計規範

   顏色來源：functional-gradients.css
   會自動支援亮色/暗色模式
   ================================ */

/* 主要按鈕 - 使用品牌色漸層 */
.btn-primary,
.big-btn.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary, #667eea) 0%, var(--brand-secondary, #764ba2) 100%);
    color: var(--color-text-on-brand, white);
}

/* 功能按鈕 - 使用 functional-gradients.css 的變數 */
.btn-success,
.big-btn.btn-success {
    background: var(--gradient-emerald);
    color: white;
}

.btn-warning,
.big-btn.btn-warning {
    background: var(--gradient-amber);
    color: white;
}

.btn-info,
.big-btn.btn-info {
    background: var(--gradient-blue);
    color: white;
}

.btn-purple,
.big-btn.btn-purple {
    background: var(--gradient-purple);
    color: white;
}

.btn-pink,
.big-btn.btn-pink {
    background: var(--gradient-pink);
    color: white;
}

.btn-teal,
.big-btn.btn-teal {
    background: var(--gradient-teal);
    color: white;
}

.btn-orange,
.big-btn.btn-orange {
    background: var(--gradient-orange);
    color: white;
}

.btn-indigo,
.big-btn.btn-indigo {
    background: var(--gradient-indigo);
    color: white;
}

.btn-cyan,
.big-btn.btn-cyan {
    background: var(--gradient-cyan);
    color: white;
}

.btn-slate,
.big-btn.btn-slate {
    background: var(--gradient-slate);
    color: white;
}

/* ================================
   相容性與增強樣式 (從 tablet_base.html 遷移)
   ================================ */

:root {
    /* 變數別名相容性 */
    --brand-primary-color: var(--brand-primary);
    --brand-secondary-color: var(--brand-secondary);
    --brand-accent-color: var(--brand-accent);
}

/* 分區分隔線 (Section Divider) */
.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 20px 0;
    padding: 0 4px;
}

.section-divider-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-section-title, #4a5568);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    font-family: var(--font-display, serif);
}

.section-divider-line {
    flex: 1;
    height: 2px;
    background: var(--color-section-line, linear-gradient(90deg, var(--brand-primary) 0%, transparent 100%));
    border-radius: 1px;
}

/* 儀表板訂閱/警告框 */
.dashboard-subscription-alert {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-subscription-alert.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    color: #92400e;
}

.dashboard-subscription-alert.error {
    background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
    color: #991b1b;
}

/* 暗色模式下警告框調整 */
html[data-theme="dark"] .dashboard-subscription-alert.warning {
    background: linear-gradient(135deg, #362a10 0%, #3d3012 100%);
    color: #fcd34d;
    border: 1px solid #78560e;
}

html[data-theme="dark"] .dashboard-subscription-alert.error {
    background: linear-gradient(135deg, #361414 0%, #401717 100%);
    color: #fca5a5;
    border: 1px solid #8b1c1c;
}

/* 品牌色選擇器樣式 (Brand Switcher) */
.brand-switcher {
    position: relative;
}

.brand-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-bg-card, white);
    border-radius: 16px;
    padding: 8px;
    min-width: 160px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.2s ease;
}

.brand-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.brand-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary, #333);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.brand-option:hover {
    background: var(--color-bg-elevated, #f5f5f5);
}

.brand-option.active {
    background: var(--brand-primary-light, rgba(0, 0, 0, 0.1));
}

.brand-swatch {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 暗色模式下的品牌選擇器 */
html[data-theme="dark"] .brand-menu {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border, #363e47);
}

html[data-theme="dark"] .brand-option {
    color: var(--color-text-primary);
}

html[data-theme="dark"] .brand-option:hover {
    background: var(--color-bg-elevated);
}