/* Custom CSS for Taiwan Cat Food Selection Website */

/* Global Styles */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f8b500;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --text-color: #333;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Product image hover enlarge */
#catFoodTable td { position: relative; overflow: visible; }
#catFoodTable img.img-thumbnail {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform-origin: center center;
}
#catFoodTable img.img-thumbnail:hover {
    position: relative;
    z-index: 20;
    transform: scale(1.6);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3d72 100%) !important;
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.3s ease;
    margin: 0 0.5rem;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3d72 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="20" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="80" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-icon {
    font-size: 15rem;
    color: rgba(255, 255, 255, 0.1);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.btn {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-warning {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--dark-color);
}

.btn-warning:hover {
    background-color: #e6a500;
    border-color: #e6a500;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 2rem;
}

/* Search Form */
.search-form {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-select, .form-control {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* Filter Controls */
.filter-controls {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Data Table */
.table-responsive {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#catFoodTable {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--dark-color), #34495e) !important;
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-align: center;
    vertical-align: middle;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    text-align: center;
    border-color: var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(44, 90, 160, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(44, 90, 160, 0.05);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.badge-age-kitten {
    background-color: var(--info-color);
    color: white;
}

.badge-age-adult {
    background-color: var(--success-color);
    color: white;
}

.badge-age-senior {
    background-color: var(--warning-color);
    color: white;
}

.badge-protein-high {
    background-color: var(--accent-color);
    color: white;
}

.badge-protein-medium {
    background-color: var(--warning-color);
    color: white;
}

.badge-protein-normal {
    background-color: var(--success-color);
    color: white;
}

/* Buttons */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 20px;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.btn-outline-success:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-icon {
        font-size: 8rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1rem 0;
    }
    
    .hero-icon {
        font-size: 6rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Comparison Section */
.comparison-container {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.comparison-details .bg-light {
    border: 1px solid var(--border-color);
}

/* Guide Cards */
.guide-card {
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.guide-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #1e3d72);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    font-weight: 600;
}

/* Toast Styles */
.toast {
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* DataTables Custom Styles */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 1rem 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 5px;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Print Styles */
@media print {
    .navbar,
    .hero-section,
    .btn {
        display: none !important;
    }

    .table {
        font-size: 12px;
    }
}
