/* Global CSS for Toysub Application */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700&display=swap');

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* System-wide background decorations */
.bg-decoration {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.bg-decoration .decoration-1 {
    position: absolute;
    top: -10rem;
    left: -10rem;
    width: 20rem;
    height: 20rem;
    background: #fde047;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(80px);
    opacity: 0.2;
    animation: pulse 4s ease-in-out infinite;
}

.bg-decoration .decoration-2 {
    position: absolute;
    bottom: -10rem;
    right: -10rem;
    width: 20rem;
    height: 20rem;
    background: #f9a8d4;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(80px);
    opacity: 0.2;
    animation: pulse 4s ease-in-out infinite;
    animation-delay: 2s;
}

.bg-decoration .decoration-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20rem;
    height: 20rem;
    background: #e9d5ff;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(80px);
    opacity: 0.1;
    animation: pulse 4s ease-in-out infinite;
    animation-delay: 4s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.3; }
}

/* Form container styles */
.form-container,
.log-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    position: relative;
}

.form-container::before,
.log-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
}

/* Colored form elements */
.form-category {
    background: linear-gradient(to bottom right, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 1rem;
}

.form-material {
    background: linear-gradient(to bottom right, #fefce8, #fef3c7);
    border: 1px solid #fde047;
    border-radius: 12px;
    padding: 1rem;
}

.form-study-area {
    background: linear-gradient(to bottom right, #faf5ff, #f3e8ff);
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    padding: 1rem;
}

.form-function {
    background: linear-gradient(to bottom right, #fdf2f8, #fce7f3);
    border: 1px solid #fbcfe8;
    border-radius: 12px;
    padding: 1rem;
}

.form-tag {
    background: linear-gradient(to bottom right, #f0fdfa, #ccfbf1);
    border: 1px solid #99f6e4;
    border-radius: 12px;
    padding: 1rem;
}

.form-origin {
    background: linear-gradient(to bottom right, #f0fdfa, #d1fae5);
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 1rem;
}

.form-rack {
    background: linear-gradient(to bottom right, #fff7ed, #fed7aa);
    border: 1px solid #fdba74;
    border-radius: 12px;
    padding: 1rem;
}

/* Multi-select styles */
.multi-select {
    min-height: 150px;
}

/* Page title styling */
.page-title {
    font-family: 'Baloo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 600;
}

/* x-cloak styling */
[x-cloak] {
    display: none !important;
}

/* Dropdown container styling */
.dropdown-container {
    position: relative;
}

/* Breadcrumb 樣式 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #2563eb;
}

.breadcrumb .separator {
    color: #9ca3af;
}

.breadcrumb .current {
    color: #1f2937;
    font-weight: 500;
}

/* Toy Management Header Styles */
/* 懸停圖片樣式 */
.thumbnail-container {
    position: relative;
    display: inline-block;
}

.thumbnail-container .hover-image {
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    margin-right: 10px;
    z-index: 100;
    border: 2px solid #ccc;
    background-color: white;
    padding: 5px;
    max-width: 600px;
    max-height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hover-image {
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    margin-right: 10px;
    z-index: 100;
    border: 2px solid #ccc;
    background-color: white;
    padding: 5px;
    width: 600px;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hover-image img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-container img {
    transition: transform 0.2s ease;
}

.thumbnail-container:hover img {
    transform: scale(1.05);
}

/* Tab Active Styles */
.tab-active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    border-radius: 8px 8px 0 0 !important;
}

/* Ensure tab-active overrides all default tab styles */
a.tab-active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    border-radius: 8px 8px 0 0 !important;
}

/* Log Table Styles */
.log-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.log-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.log-table tr:hover {
    background-color: #f9fafb;
}

/* Log Type Badge Styles */
.log-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.system-log-badge {
    background-color: #dbeafe;
    color: #1e40af;
}

.toy-item-log-badge {
    background-color: #d1fae5;
    color: #065f46;
}

/* Status Badge Styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.from-status {
    background-color: #f3f4f6;
    color: #6b7280;
    text-decoration: line-through;
}

.to-status {
    background-color: #dbeafe;
    color: #1e40af;
}

/* UUID Truncate Style */
.uuid-truncate {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Attachment Container Styles */
.attachment-container {
    background: linear-gradient(145deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 15px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.attachment-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.attachment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.attachment-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.attachment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

/* Mobile Responsive Styles */
@media (max-width: 639px) {
    .multi-select {
        height: 2.5rem;
        min-height: 2.5rem;
        font-size: 0.875rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .container.mx-auto.px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* 調整頁面標題區域的佈局 */
    .flex.justify-between.items-center.mb-8 {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    /* 標題區域置中 */
    .text-4xl.font-bold.text-white.mb-2 {
        font-size: 2rem;
        text-align: center;
    }

    .text-white\/80.text-sm {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    /* 手機版排序按鈕調整 */
    .flex.items-center.space-x-3 {
        gap: 0.5rem !important;
    }

    .px-4.py-2.rounded-lg.border-2.cursor-pointer {
        padding: 0.5rem 0.625rem !important;
        min-width: auto !important;
        flex-shrink: 0;
    }

    .fas {
        font-size: 0.875rem !important;
    }

    /* 縮小圖片 */
    .w-24.h-24 {
        width: 4rem;
        height: 4rem;
    }

    /* Tab 響應式 */
    .flex.space-x-4 {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .px-4.py-2 {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* 手機版 UUID 截斷更短 */
    .uuid-truncate {
        max-width: 80px;
    }

    /* 隱藏部分欄位 */
    .hide-mobile {
        display: none;
    }

    /* 表格響應式 */
    .log-table {
        font-size: 0.875rem;
    }

    .log-table th,
    .log-table td {
        padding: 0.5rem;
    }
}

/* ===================================
   REUSABLE COMPONENT STYLES
   =================================== */

/* Form Components */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 1);
}

/* Button Variants */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Card Components */
.card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.card-elevated {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    background: rgba(249, 250, 251, 0.5);
}

/* Table Components */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    color: #374151;
}

.data-table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Modal Components */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
}

.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    margin: 2rem auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Layout Utilities */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

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

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

.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Transition Utilities */
.transition-all {
    transition: all 0.3s ease;
}

.transition-transform {
    transition: transform 0.3s ease;
}

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

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-gray {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Tooltip Component */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 320px;
    background-color: #1f2937;
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -160px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip-title {
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 8px;
    font-size: 1rem;
    border-bottom: 1px solid #374151;
    padding-bottom: 6px;
}

.tooltip-description {
    margin-bottom: 8px;
}

.tooltip-formula {
    background-color: #374151;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    margin-top: 8px;
    border-left: 3px solid #f59e0b;
}

.tooltip-note {
    font-style: italic;
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 8px;
}

/* Feedback Link Component */
.feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #3b82f6;
    text-decoration: none;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    transition: all 0.2s ease;
}

.feedback-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
    text-decoration: none;
}

.feedback-link i {
    font-size: 0.8rem;
}

.feedback-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Management Link Component (Orange theme for staff) */
.management-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #ea580c;
    text-decoration: none;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    transition: all 0.2s ease;
}

.management-link:hover {
    background: #fde68a;
    color: #c2410c;
    border-color: #fdba74;
    text-decoration: none;
}

.management-link i {
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .feedback-link, .management-link {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .feedback-text {
        display: none;
    }

    .feedback-link i, .management-link i {
        font-size: 0.9rem;
    }
}

/* =============================================
   TOY ITEM STATUS BADGE COMPONENTS
   ============================================= */

/* Toy Item Status Badges - Reusable across all templates */
.toy-item-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

/* Status-specific colors */
.toy-item-status-badge.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.toy-item-status-badge.hold {
    background: #e0e7ff;
    color: #3730a3;
}

.toy-item-status-badge.in-delivery {
    background: #dbeafe;
    color: #1e40af;
}

.toy-item-status-badge.cleaning {
    background: #fef3c7;
    color: #92400e;
}

.toy-item-status-badge.washing {
    background: #e0f2fe;
    color: #0c4a6e;
}

.toy-item-status-badge.fixing {
    background: #fee2e2;
    color: #991b1b;
}

.toy-item-status-badge.missing-parts {
    background: #fecaca;
    color: #7f1d1d;
}

.toy-item-status-badge.damaged {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.toy-item-status-badge.retired {
    background: #f3f4f6;
    color: #374151;
}

.toy-item-status-badge.inspecting {
    background: #fed7aa;
    color: #9a3412;
}

/* Special badges for compensation and birthday gifts */
.toy-item-special-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.toy-item-special-badge.compensation {
    background: #fee2e2;
    color: #991b1b;
}

.toy-item-special-badge.birthday {
    background: #fef3c7;
    color: #92400e;
}

/* Toy Card Mini Component - for compact displays */
.toy-card-mini {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
}

.toy-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.toy-card-mini.inspecting {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toy-card-mini-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.toy-card-mini-content {
    padding: 0.5rem;
}

.toy-card-mini-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.toy-card-mini-key {
    font-size: 0.7rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    display: inline-block;
}

.toy-card-mini-badges {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* =============================================
   DATE NAVIGATION COMPONENT
   ============================================= */

.date-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.date-nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-nav-button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    transition: all 0.2s;
}

.date-nav-button:hover {
    background: #e5e7eb;
}

.current-date {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: right;
    margin-left: auto; /* 這會讓它靠右 */
}

.current-date.today {
    color: #dc2626;
}

.today-badge {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =============================================
   CONTENT CONTAINER COMPONENTS
   ============================================= */

/* Light content container for dark backgrounds */
.content-container-light {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Content wrapper for page sections */
.page-content-wrapper {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* =============================================
   TOY CATALOG COMPONENTS
   ============================================= */

/* Toy Card Component - Used in both public and staff toy catalog pages */
.toy-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.toy-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #fbbf24;
}

.toy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toy-card:hover::before {
    opacity: 1;
}

/* Card Image Container */
.toy-card .card-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.toy-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.toy-card:hover .card-image {
    transform: scale(1.05);
}

.toy-card .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toy-card:hover .image-overlay {
    opacity: 1;
}

.toy-card .quick-view-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toy-card:hover .quick-view-icon {
    opacity: 1;
}

/* Card Content */
.toy-card .card-content {
    padding: 1.25rem;
}

.toy-card .toy-name {
    font-family: 'Baloo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    min-height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toy-card .toy-product-key {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.75rem;
}

/* Stock Badge */
.toy-card .stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.toy-card .stock-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

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

/* Timestamps */
.toy-card .timestamps {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

/* Toy Grid Layouts */
.toy-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .toy-grid {
        gap: 1rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .toy-grid {
        gap: 1.25rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .toy-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Sparse Display */
.toy-grid.sparse-display {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .toy-grid.sparse-display {
        gap: 1rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .toy-grid.sparse-display {
        gap: 1.25rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Medium Display */
.toy-grid.medium-display {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.625rem;
}

@media (min-width: 640px) {
    .toy-grid.medium-display {
        gap: 0.875rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .toy-grid.medium-display {
        gap: 1rem;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .toy-grid.medium-display {
        gap: 1.25rem;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Dense Display */
.toy-grid.dense-display {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .toy-grid.dense-display {
        gap: 0.75rem;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .toy-grid.dense-display {
        gap: 0.875rem;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .toy-grid.dense-display {
        gap: 1rem;
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .toy-grid.dense-display {
        gap: 1rem;
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
}

/* Dense Mode Scaling */
@media (min-width: 1024px) {
    .toy-grid.dense-display .toy-card {
        transform: scale(0.85);
        transition: transform 0.3s ease;
    }

    .toy-grid.dense-display .toy-card:hover {
        transform: scale(0.87) translateY(-4px);
    }

    .toy-grid.dense-display .card-image-container {
        height: 160px;
    }

    .toy-grid.dense-display .card-content {
        padding: 0.875rem;
    }

    .toy-grid.dense-display .toy-name {
        font-size: 0.875rem;
        min-height: 2.2rem;
        line-height: 1.2;
    }

    .toy-grid.dense-display .toy-product-key {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.625rem;
        margin-bottom: 0.5rem;
    }

    .toy-grid.dense-display .stock-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }

    .toy-grid.dense-display .timestamps {
        font-size: 0.6875rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .toy-grid.dense-display .quick-view-icon {
        font-size: 1.5rem;
    }
}

/* Medium Mode Scaling */
@media (min-width: 1280px) {
    .toy-grid.medium-display .toy-card {
        transform: scale(0.95);
    }

    .toy-grid.medium-display .toy-card:hover {
        transform: scale(0.97) translateY(-6px);
    }
}

/* Mobile Responsive for Toy Cards */
@media (max-width: 639px) {
    .toy-card {
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .toy-card:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .toy-card .card-image-container {
        height: 120px !important;
    }

    .toy-card .card-content {
        padding: 0.625rem !important;
    }

    .toy-card .toy-name {
        font-size: 0.75rem !important;
        min-height: 1.8rem !important;
        line-height: 1.1 !important;
    }

    .toy-card .toy-product-key {
        font-size: 0.625rem !important;
        padding: 0.125rem 0.5rem !important;
        margin-bottom: 0.375rem !important;
        border-radius: 12px !important;
    }

    .toy-card .stock-badge {
        font-size: 0.6875rem !important;
        padding: 0.1875rem 0.5rem !important;
        border-radius: 8px !important;
    }

    .toy-card .timestamps {
        font-size: 0.625rem !important;
        margin-top: 0.375rem !important;
        padding-top: 0.375rem !important;
    }

    .toy-card .quick-view-icon {
        font-size: 1.25rem !important;
    }

    /* Hide elements on mobile */
    .toy-card .timestamps {
        display: none !important;
    }

    .mb-3:has(.stock-badge) {
        display: none !important;
    }

    .toy-card .stock-badge {
        min-height: 28px;
        display: inline-flex;
        align-items: center;
    }

    .toy-card .card-content {
        padding-bottom: 0.75rem !important;
    }
}

/* Toy Catalog Animation */
@keyframes toyCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toy-card {
    animation: toyCardSlideIn 0.5s ease forwards;
}

.toy-card:nth-child(1) { animation-delay: 0.05s; }
.toy-card:nth-child(2) { animation-delay: 0.1s; }
.toy-card:nth-child(3) { animation-delay: 0.15s; }
.toy-card:nth-child(4) { animation-delay: 0.2s; }
.toy-card:nth-child(5) { animation-delay: 0.25s; }
.toy-card:nth-child(6) { animation-delay: 0.3s; }

/* =============================================
   SHARED COMPONENT STYLES
   ============================================= */

/* Base Card Component - used across multiple templates */
.card-base {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Stat Card Components - common styling for statistics */
.stat-card-base {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-left: 4px solid #3b82f6;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Stat Card Variants */
.stat-card-primary { border-left-color: #3b82f6; }
.stat-card-warning { border-left-color: #f59e0b; }
.stat-card-success { border-left-color: #10b981; }
.stat-card-danger { border-left-color: #ef4444; }

/* Date Navigation Components */
.date-nav-base {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.date-nav-btn-base {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    transition: all 0.2s;
}

.date-nav-btn-base:hover {
    background: #e5e7eb;
}

/* Date Navigation with Gradient (for tasks page) */
.date-nav-btn-gradient {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.date-nav-btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Today Badge Component */
.today-badge {
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.today-badge-small {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Status Badge Components */
.status-success {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-warning {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Grid Components */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.grid-auto-fit-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.grid-fixed-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.grid-fixed-7 {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
}

/* Responsive adjustments for grid-fixed-4 */
@media (max-width: 1024px) {
    .grid-fixed-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-fixed-4 {
        grid-template-columns: 1fr;
    }
}

/* Table Base Components */
.table-base {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.table-header {
    background: #f3f4f6;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-cell {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}

.table-row-hover:hover {
    background: #f9fafb;
    transition: background-color 0.2s;
}

/* =============================================
   FLASH MESSAGE COMPONENTS
   ============================================= */

/* Flash Message Container - positioned at the top of page content */
.flash-message-container {
    margin-bottom: 2rem;
}

/* Base Flash Message Styles */
.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
    margin-bottom: 1rem;
}

/* Flash Message Variants */
.flash-message.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.flash-message.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.flash-message.alert-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #d97706;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.flash-message.alert-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* Left side accent bar for visual enhancement */
.flash-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.8;
}

.flash-message.alert-success::before {
    background: linear-gradient(180deg, #065f46 0%, #10b981 100%);
}

.flash-message.alert-danger::before {
    background: linear-gradient(180deg, #991b1b 0%, #ef4444 100%);
}

.flash-message.alert-warning::before {
    background: linear-gradient(180deg, #92400e 0%, #f59e0b 100%);
}

.flash-message.alert-info::before {
    background: linear-gradient(180deg, #1e40af 0%, #3b82f6 100%);
}

/* Flash Message Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Legacy Bootstrap alert support */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
    margin-bottom: 1rem;
}

.alert-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.alert-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.alert-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #d97706;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.alert-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* Apply accent bar to legacy alerts */
.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.8;
}

.alert-success::before {
    background: linear-gradient(180deg, #065f46 0%, #10b981 100%);
}

.alert-danger::before {
    background: linear-gradient(180deg, #991b1b 0%, #ef4444 100%);
}

.alert-warning::before {
    background: linear-gradient(180deg, #92400e 0%, #f59e0b 100%);
}

.alert-info::before {
    background: linear-gradient(180deg, #1e40af 0%, #3b82f6 100%);
}