/* 
 * PsyGuild Homepage V2 Styles
 * Pixel-perfect alignment with new Figma Design
 */

 :root {
    --pgh-primary: #8b5cf6; /* Violet */
    --pgh-primary-hover: #7c3aed;
    --pgh-cyan: #06b6d4;
    --pgh-purple: #8b5cf6;
    --pgh-blue: #3b82f6;
    --pgh-orange: #f97316;
    --pgh-text-main: #0f172a;
    --pgh-text-muted: #64748b;
    --pgh-border: rgba(15, 23, 42, 0.08);
    --pgh-bg: #f8fafc;
    --pgh-card-bg: rgba(255, 255, 255, 0.7); /* Glassmorphism base */
    --pgh-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pg-home-v2 {
    font-family: var(--pgh-font);
    color: var(--pgh-text-main);
    background-color: var(--pgh-bg);
    line-height: 1.5;
}

/* Animations & Micro-interactions */
@keyframes pghFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pghGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes pghPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
}

@keyframes pghScrollReveal {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}
.pgh-reveal-item {
    opacity: 0;
}
.pgh-revealed {
    animation: pghScrollReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.pgh-reveal-delay-1 { animation-delay: 0.1s; }
.pgh-reveal-delay-2 { animation-delay: 0.2s; }
.pgh-reveal-delay-3 { animation-delay: 0.3s; }


.pgh-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Utilities */
.pgh-text-purple { color: var(--pgh-purple) !important; }
.pgh-text-blue { color: var(--pgh-primary) !important; }
.pgh-text-orange { color: var(--pgh-orange) !important; }

.pgh-bg-slate { background: #f1f5f9; color: #475569; }
.pgh-bg-blue { background: #eff6ff; color: #3b82f6; }
.pgh-bg-purple { background: #faf5ff; color: #9333ea; }
.pgh-bg-orange { background: #fff7ed; color: #ea580c; }

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

/* Cards (Glassmorphism style) */
.pgh-card {
    background: var(--pgh-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--pgh-border);
    border-radius: 24px;
    box-shadow: 0 4px 20px -2px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.pgh-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 40px -10px rgba(0,0,0,0.08), 0 10px 20px -10px rgba(0,0,0,0.04);
    border-color: rgba(139, 92, 246, 0.3); /* Violet border on hover */
    background: rgba(255, 255, 255, 0.9);
}
.pgh-card img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.pgh-card:hover img {
    transform: scale(1.05);
}

/* Buttons */
.pgh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.pgh-btn--primary {
    background-image: linear-gradient(to right, var(--pgh-primary) 0%, var(--pgh-purple) 50%, var(--pgh-primary) 100%);
    background-size: 200% auto;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    border: none;
}
.pgh-btn--primary:hover {
    background-position: right center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}
.pgh-btn--outline {
    background-color: #fff;
    color: var(--pgh-text-main);
    border: 1px solid var(--pgh-border);
}
.pgh-btn--outline:hover {
    background-color: #f1f5f9;
}

/* --- HERO SECTION --- */
.pgh-hero {
    position: relative;
    padding: 80px 0 100px;
    background: radial-gradient(circle at 80% -20%, rgba(139, 92, 246, 0.15) 0%, rgba(255, 255, 255, 0) 50%), 
                radial-gradient(circle at -20% 50%, rgba(6, 182, 212, 0.1) 0%, rgba(255, 255, 255, 0) 50%), 
                var(--pgh-bg);
    border-bottom: 1px solid var(--pgh-border);
    overflow: hidden;
}
.pgh-hero::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, rgba(6,182,212,0.08) 30%, transparent 60%);
    z-index: 0;
    animation: pghFloat 12s ease-in-out infinite;
    pointer-events: none;
}
.pgh-hero__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 60px;
    align-items: center;
}
.pgh-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    color: var(--pgh-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.pgh-hero__eyebrow svg { width: 14px; height: 14px; }

.pgh-hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: #0f172a;
}
.pgh-gradient-text {
    background: linear-gradient(270deg, var(--pgh-primary), var(--pgh-cyan), var(--pgh-purple), var(--pgh-primary));
    background-size: 300% 300%;
    animation: pghGradientShift 8s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.pgh-hero__desc {
    font-size: 1.125rem;
    color: var(--pgh-text-muted);
    margin-bottom: 32px;
    max-width: 540px;
    line-height: 1.6;
}
.pgh-hero__actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

/* Search Bar */
.pgh-hero__search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--pgh-border);
    border-radius: 12px;
    padding: 6px;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.pgh-hero__search:focus-within {
    border-color: var(--pgh-primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}
.pgh-hero__search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--pgh-text-main);
    outline: none;
}
.pgh-hero__search input::placeholder { color: #94a3b8; }
.pgh-hero__search button {
    background: transparent;
    border: none;
    color: var(--pgh-text-muted);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pgh-hero__search button svg { width: 20px; height: 20px; }

/* Hero Right Side */
.pgh-hero__side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.pgh-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pgh-border);
    background: #fafafc;
}
.pgh-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
}
.pgh-card__title svg { width: 18px; height: 18px; color: var(--pgh-primary); }
.pgh-card__link {
    font-size: 0.85rem;
    color: var(--pgh-primary);
    text-decoration: none;
    font-weight: 600;
}
.pgh-card__link:hover { text-decoration: underline; }

/* Map Grid */
.pgh-map__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
}
.pgh-map__item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.pgh-map__item:hover {
    background: #f8fafc;
    border-color: var(--pgh-border);
}
.pgh-map__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pgh-map__item:hover .pgh-map__icon {
    transform: scale(1.1) rotate(5deg);
}
.pgh-map__icon svg { width: 20px; height: 20px; }
.pgh-map__text {
    display: flex;
    flex-direction: column;
}
.pgh-map__text strong { font-size: 0.9rem; color: #1e293b; }
.pgh-map__text span { font-size: 0.75rem; color: var(--pgh-text-muted); margin-top: 2px; }

/* Authors List */
.pgh-authors__list {
    display: flex;
    flex-direction: column;
}
.pgh-authors__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    text-decoration: none;
    border-bottom: 1px solid var(--pgh-border);
    transition: background 0.2s;
}
.pgh-authors__item:last-child { border-bottom: none; }
.pgh-authors__item:hover { background: #f8fafc; }
.pgh-author__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.pgh-author__info { flex: 1; display: flex; flex-direction: column; }
.pgh-author__info strong { font-size: 0.95rem; color: #1e293b; }
.pgh-author__info span { font-size: 0.8rem; color: var(--pgh-text-muted); }
.pgh-author__badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 12px;
    font-weight: 500;
}

/* --- COMMON SECTIONS --- */
.pgh-section {
    padding: 80px 0;
}
.pgh-bg-alt {
    background: #fff;
    border-top: 1px solid var(--pgh-border);
    border-bottom: 1px solid var(--pgh-border);
}
.pgh-section__head {
    margin-bottom: 40px;
}
.pgh-section__eyebrow {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px 0;
}
.pgh-section__eyebrow::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2'%3E%3Cpath d='M12 3l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3C/svg%3E") no-repeat center;
}
.pgh-section__subtitle {
    display: block;
    font-size: 1rem;
    color: var(--pgh-text-muted);
    max-width: 700px;
}
.pgh-section__link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pgh-primary);
    text-decoration: none;
}
.pgh-section__link:hover { text-decoration: underline; }

/* Grids */
.pgh-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pgh-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.pgh-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

/* Giới thiệu PsyGuild (Feature Cards) */
.pgh-feature-card {
    padding: 32px;
    text-align: left;
}
.pgh-fc__icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.pgh-feature-card:hover .pgh-fc__icon {
    transform: translateY(-8px) scale(1.05);
}
.pgh-theme-blue:hover .pgh-fc__icon { box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2); }
.pgh-theme-purple:hover .pgh-fc__icon { box-shadow: 0 10px 20px rgba(147, 51, 234, 0.2); }
.pgh-theme-orange:hover .pgh-fc__icon { box-shadow: 0 10px 20px rgba(234, 88, 12, 0.2); }
.pgh-fc__icon svg { width: 32px; height: 32px; }
.pgh-theme-blue .pgh-fc__icon { background: #eff6ff; color: #3b82f6; }
.pgh-theme-purple .pgh-fc__icon { background: #faf5ff; color: #9333ea; }
.pgh-theme-orange .pgh-fc__icon { background: #fff7ed; color: #ea580c; }
.pgh-fc__content h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; color: #0f172a; }
.pgh-fc__content p { color: var(--pgh-text-muted); margin-bottom: 24px; line-height: 1.6; }
.pgh-fc__content a {
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}
.pgh-theme-blue a { color: #3b82f6; }
.pgh-theme-purple a { color: #9333ea; }
.pgh-theme-orange a { color: #ea580c; }
.pgh-fc__content a:hover { text-decoration: underline; }

/* Kho tri thức */
.pgh-knowledge-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.pgh-kc__img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid var(--pgh-border);
}
.pgh-kc__content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.pgh-kc__content h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: #0f172a; }
.pgh-kc__content p { font-size: 0.9rem; color: var(--pgh-text-muted); margin-bottom: 24px; flex: 1; }
.pgh-kc__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pgh-text-muted);
}
.pgh-knowledge-card:hover .pgh-kc__footer span:last-child {
    color: var(--pgh-primary);
    transform: translateX(4px);
    transition: 0.2s;
}

/* Tin tức & Báo chí */
.pgh-news__grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
}
.pgh-news-featured {
    position: relative;
    display: block;
    height: 400px;
}
.pgh-nf__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pgh-nf__content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 60px 32px 32px;
    background: linear-gradient(to top, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.8) 40%, transparent 100%);
    color: #fff;
    transition: padding-bottom 0.4s ease;
}
.pgh-news-featured:hover .pgh-nf__content {
    padding-bottom: 40px;
}
.pgh-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.pgh-badge--blue { background: var(--pgh-primary); color: #fff; }
.pgh-nf__content h3 { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.pgh-nf__content p { font-size: 1rem; opacity: 0.9; margin-bottom: 16px; }
.pgh-nf__meta { font-size: 0.85rem; opacity: 0.8; display: flex; gap: 8px; }

.pgh-news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.pgh-nl__item {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    align-items: center;
}
.pgh-nl__img {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}
.pgh-nl__content { flex: 1; }
.pgh-nl__cat { font-size: 0.75rem; font-weight: 700; color: var(--pgh-primary); margin-bottom: 4px; display: block; }
.pgh-nl__content h4 { font-size: 1rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; color: #0f172a; }
.pgh-nl__meta { font-size: 0.8rem; color: var(--pgh-text-muted); }
.pgh-nl__item:hover h4 { color: var(--pgh-primary); }

/* Lượng giá & Công cụ */
.pgh-tool-card {
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pgh-tc__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.pgh-tool-card:hover .pgh-tc__icon {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.pgh-tc__icon svg { width: 32px; height: 32px; }
.pgh-tool-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; color: #0f172a; }
.pgh-tool-card p { font-size: 0.95rem; color: var(--pgh-text-muted); margin-bottom: 24px; line-height: 1.5; flex: 1; }
.pgh-btn-light {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
}
.pgh-btn-light:hover { background: #e2e8f0; }

/* Bài viết mới */
.pgh-latest-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.pgh-lc__img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-bottom: 1px solid var(--pgh-border);
}
.pgh-lc__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.pgh-lc__content h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
    color: #0f172a;
    flex: 1;
}
.pgh-lc__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pgh-lc__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
}
.pgh-lc__author img { border-radius: 50%; }
.pgh-lc__date { font-size: 0.8rem; color: var(--pgh-text-muted); }

/* Responsive */
@media (max-width: 1024px) {
    .pgh-hero__grid { grid-template-columns: 1fr; }
    .pgh-hero__title { font-size: 3rem; }
    .pgh-grid-4, .pgh-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .pgh-news__grid { grid-template-columns: 1fr; }
    .pgh-news-featured { height: 300px; }
}
@media (max-width: 768px) {
    .pgh-hero__title { font-size: 2.25rem; }
    .pgh-grid-3 { grid-template-columns: 1fr; }
    .pgh-map__grid { grid-template-columns: 1fr; }
    .pgh-hero__actions { flex-direction: column; }
    .pgh-grid-4, .pgh-grid-5 { grid-template-columns: 1fr; }
    .pgh-news-list { margin-top: 24px; }
    .pgh-section { padding: 40px 0; }
}
