/**
 * 跨域學習成果平台 - 前台樣式
 * Cross-Domain Learning Platform - Frontend Styles
 */

/* AOS Fallback - 當沒有 JS 時確保內容顯示 */
.no-js [data-aos] {
    opacity: 1 !important;
    transform: none !important;
}

:root {
    --cd-primary: #667eea;
    --cd-secondary: #764ba2;
    --cd-success: #10b981;
    --cd-danger: #ef4444;
    --cd-warning: #f59e0b;
    --cd-info: #3b82f6;
    --cd-dark: #1e293b;
    --cd-light: #f8fafc;
    --cd-gradient: linear-gradient(135deg, var(--cd-primary) 0%, var(--cd-secondary) 100%);
}

/* 基本設定 */
body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: var(--cd-light);
}

main {
    padding-top: 76px; /* Navbar height */
    min-height: calc(100vh - 300px);
}

a {
    color: var(--cd-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--cd-secondary);
}

/* Navbar */
.navbar {
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.25rem;
    color: var(--cd-primary) !important;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
}

.navbar .nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--cd-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .nav-link:hover:after,
.navbar .nav-link.active:after {
    width: 80%;
}

.navbar .nav-link.active {
    color: var(--cd-primary) !important;
}

/* Hero Section */
.hero-section {
    background: var(--cd-gradient);
    color: white;
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: white;
    border-bottom: 2px solid var(--cd-light);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-card .stat-icon.bg-primary { background: var(--cd-gradient); }
.stat-card .stat-icon.bg-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card .stat-icon.bg-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card .stat-icon.bg-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cd-dark);
}

.stat-card .stat-label {
    color: #475569; /* WCAG AA compliant - 5.9:1 contrast */
    font-size: 0.9rem;
}

/* Achievement Cards */
.achievement-card {
    height: 100%;
}

.achievement-card .card-body {
    padding: 1.5rem;
}

.achievement-card .team-name {
    color: var(--cd-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.achievement-card .work-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--cd-dark);
}

.achievement-card .abstract {
    color: #475569; /* WCAG AA compliant - 5.9:1 contrast */
    font-size: 0.9rem;
    line-height: 1.6;
}

.achievement-card .meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b; /* WCAG AA compliant - 4.5:1 contrast (upgraded from #94a3b8) */
}

/* Event Cards */
.event-card {
    position: relative;
}

.event-card .event-date {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--cd-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    z-index: 1;
}

.event-card .event-date .day {
    font-size: 1.5rem;
    line-height: 1;
}

.event-card .event-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.event-card .status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
}

/* Buttons */
.btn-cd-primary {
    background: var(--cd-gradient);
    border: none;
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cd-primary:hover {
    opacity: 0.9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-cd-outline {
    border: 2px solid var(--cd-primary);
    color: var(--cd-primary);
    background: transparent;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cd-outline:hover {
    background: var(--cd-gradient);
    border-color: transparent;
    color: white;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cd-dark);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #475569; /* WCAG AA compliant - 5.9:1 contrast */
    font-size: 1.1rem;
}

.section-header .divider {
    width: 60px;
    height: 4px;
    background: var(--cd-gradient);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Badges */
.badge-sdg {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-award {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.badge-award.first { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: white; }
.badge-award.second { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); color: white; }
.badge-award.third { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); color: white; }

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cd-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--cd-dark);
    margin-bottom: 0.5rem;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 3rem;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b; /* WCAG AA compliant for icons */
}

/* Breadcrumb */
.breadcrumb-wrapper {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: #475569; /* WCAG AA compliant - 5.9:1 contrast */
}

.breadcrumb-item.active {
    color: var(--cd-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b; /* WCAG AA compliant (upgraded from #94a3b8) */
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7; /* Increased for better visibility */
}

.empty-state h4 {
    color: #475569; /* WCAG AA compliant */
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination .page-link {
    border: none;
    color: #475569; /* WCAG AA compliant - 5.9:1 contrast */
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
}

.pagination .page-item.active .page-link {
    background: var(--cd-gradient);
    color: white;
}

.pagination .page-link:hover {
    background: #f1f5f9;
    color: var(--cd-primary);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--cd-gradient);
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    color: white;
}

/* Footer */
.footer {
    background: var(--cd-dark);
}

.footer h5, .footer h6 {
    color: white;
}

.footer a:hover {
    color: var(--cd-primary) !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 60px;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .navbar, .footer, .back-to-top {
        display: none !important;
    }

    main {
        padding-top: 0;
    }
}
