/* public/css/redesign.css */

/* ---
--- VIETNAMESE COMMENT
--- File này chứa các style được thiết kế lại để mang lại giao diện hiện đại, chuyên nghiệp và thân thiện với người dùng cho nền tảng.
--- Các quy tắc tuân thủ nguyên tắc Mobile-First.
---
--- ENGLISH COMMENT
--- This file contains redesigned styles for a modern, professional, and user-friendly interface for the platform.
--- The rules follow a Mobile-First approach.
--- --- */

/* --- Biến CSS cho màu sắc và font chữ --- */
:root {
    --primary-color: #0056d2; /* Màu xanh dương chuyên nghiệp */
    --primary-hover-color: #0041a8;
    --secondary-color: #f0f8ff; /* Màu nền nhẹ nhàng */
    --text-color: #333;
    --heading-color: #1a202c;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #e2e8f0;
    --footer-bg: #1a202c;
    --footer-text-color: #cccccc; /* Cập nhật để cải thiện độ tương phản */
    --footer-heading-color: #ffffff;

    --font-family-sans: 'Be Vietnam Pro', sans-serif; /* Đã cập nhật */
    --font-family-serif: "Georgia", Cambria, "Times New Roman", Times, serif;

    --border-radius: 8px;
    --card-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px var(--shadow-color);
    --card-hover-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -2px var(--shadow-color);
}

/* --- Reset và thiết lập cơ bản --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 10000;
    font-weight: bold;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.skip-link:focus {
    top: 0;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-sans);
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75em;
    letter-spacing: -0.02em; /* Cải thiện UI/UX */
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #555;
    line-height: 1.7; /* Cải thiện khả năng đọc */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover-color);
    text-decoration: none; /* Bỏ gạch chân khi hover */
}

/* --- Header và Navigation --- */
.main-header {
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.main-header .logo a {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem; /* Tăng khoảng cách */
    align-items: center;
}

.main-nav a {
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: flex; /* Căn icon và text */
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

.header-auth a {
    margin-left: 1rem;
    text-decoration: none;
}


/* --- Icon Styles --- */
.icon {
    width: 1.2rem;
    height: 1.2rem;
    stroke-width: 2;
}


/* --- Buttons --- */
.btn {
    display: inline-flex; /* Căn icon và text */
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease; /* Hiệu ứng toàn diện */
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 86, 210, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 86, 210, 0.4);
    color: #fff;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}


/* --- Course Cards --- */
.course-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile-first: 1 cột */
    gap: 2rem;
    padding: 4rem 0;
}

.course-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-hover-shadow);
}

.course-card img {
    width: 100%;
    height: 220px; /* Tăng chiều cao ảnh */
    object-fit: cover;
    border-bottom: 3px solid var(--primary-color);
}

.course-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--heading-color);
}

.course-card-content p {
    font-size: 1rem; /* Tăng cỡ chữ để dễ đọc hơn */
    color: #666;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.course-card-content .btn {
    margin-top: auto;
    width: 100%; /* Nút chiếm toàn bộ chiều rộng */
}


/* --- Hero Section --- */
.hero-section {
    padding: 6rem 5%;
    text-align: center;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    margin-top: 2rem;
    box-shadow: var(--card-shadow);
}

.hero-section h1 {
    color: var(--heading-color);
    font-size: 3rem; 
    margin-bottom: 1rem;
}

.hero-section p {
    color: var(--text-color);
    max-width: 650px;
    margin: 0 auto 2rem auto; /* Giảm khoảng cách */
    font-size: 1.15rem;
}

.hero-section .btn {
    margin: 0.5rem;
}


/* --- Footer --- */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text-color);
    padding: 4rem 0;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.footer-column h4 {
    color: var(--footer-heading-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-column p, .footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links a {
    color: var(--footer-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.social-links a {
    color: var(--footer-text-color);
    margin-right: 1.5rem;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    font-size: 0.9rem;
}

/* --- Skeleton Loader for Course Cards --- */
.skeleton-card {
    background-color: #e2e8f0;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-card .skeleton-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

.skeleton-card .skeleton-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.skeleton-card .skeleton-text {
    background-color: #cbd5e0;
    height: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-card .skeleton-text.short {
    width: 70%;
}

.skeleton-card .skeleton-text.medium {
    width: 90%;
}

.skeleton-card .skeleton-button {
    height: 2.5rem;
    background-color: #94a3b8;
    border-radius: var(--border-radius);
    margin-top: auto;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* --- Responsive Design --- */
@media (min-width: 768px) {
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    h1, .hero-section h1 { font-size: 3.5rem; }
}

@media (min-width: 1024px) {
    .course-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
