/* Fix: Remove .post default padding/margin for hero section */
.post.profile-hero-section {
    padding: 0 !important;
    margin: 0 0 3em 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
.post.profile-hero-section > header {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    width: 100% !important;
}
/* Sakura Theme - Hoa Anh Đào */

:root {
    --sakura-pink: #ffb7c5;
    --sakura-light: #ffe4e9;
    --sakura-dark: #ff7b9d;
    --sakura-accent: #ff6b9d;
    --sakura-bg: #fff5f7;
    --sakura-white: #ffffff;
    --sakura-text: #4a4a4a;
    --sakura-text-light: #8b8b8b;
}

/* Background */
body {
    background: var(--sakura-bg) !important;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 183, 197, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 228, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 183, 197, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Header */
#header {
    background: var(--sakura-white) !important;
    border-bottom: 2px solid var(--sakura-pink) !important;
    box-shadow: 0 2px 12px rgba(255, 107, 157, 0.08) !important;
}

#header h1 a {
    color: var(--sakura-accent) !important;
    font-weight: 700 !important;
}

#header nav.links a {
    color: var(--sakura-text) !important;
    transition: all 0.3s ease;
}

#header nav.links a:hover {
    color: var(--sakura-accent) !important;
    background: var(--sakura-light) !important;
}

/* Boxes & Cards */
.box {
    background: var(--sakura-white) !important;
    border: 2px solid var(--sakura-light) !important;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.08) !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    text-align: left !important;
    overflow-wrap: break-word;
}

.box h3 {
    color: var(--sakura-accent) !important;
    border-bottom: 2px solid var(--sakura-pink);
    padding-bottom: 0.5rem;
}

.box ul.alt li {
    border-color: var(--sakura-light) !important;
    color: var(--sakura-text) !important;
}

/* Posts */
.post {
    background: var(--sakura-white) !important;
    border: 2px solid var(--sakura-light) !important;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.08) !important;
    border-radius: 12px !important;
}

.post header .title h2,
.post header .title h3 {
    color: var(--sakura-text) !important;
}

.post header .title h2 a,
.post header .title h3 a {
    color: var(--sakura-accent) !important;
}

.post header .title h2 a:hover,
.post header .title h3 a:hover {
    color: var(--sakura-dark) !important;
}

.post header .title p {
    color: var(--sakura-text-light) !important;
}

.post header .meta .published,
.post header .meta .name {
    color: var(--sakura-text-light) !important;
}

.post p {
    color: var(--sakura-text) !important;
}

/* Buttons */
.button,
input[type="submit"],
input[type="button"] {
    background: var(--sakura-accent) !important;
    color: var(--sakura-white) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.2) !important;
    transition: all 0.3s ease !important;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--sakura-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 157, 0.3) !important;
}

.button.large {
    background: linear-gradient(135deg, var(--sakura-accent) 0%, var(--sakura-dark) 100%) !important;
}

/* Links */
a {
    color: var(--sakura-accent) !important;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--sakura-dark) !important;
}

/* Sidebar */
#sidebar {
    background: var(--sakura-white) !important;
    border: 2px solid var(--sakura-light) !important;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.08) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    border-left: none !important;
    height: fit-content !important;
    align-self: flex-start !important;
    position: sticky !important;
    top: 2rem !important;
}

#sidebar section {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
}

#sidebar .blurb h2 {
    color: var(--sakura-accent) !important;
    border-bottom: 2px solid var(--sakura-pink);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Footer */
#footer {
    background: var(--sakura-white) !important;
    border-top: 2px solid var(--sakura-light) !important;
}

#footer .icons a {
    border-color: var(--sakura-pink) !important;
    color: var(--sakura-accent) !important;
}

#footer .icons a:hover {
    background: var(--sakura-accent) !important;
    border-color: var(--sakura-accent) !important;
    color: var(--sakura-white) !important;
}

/* Menu Overlay */
#menu {
    background: var(--sakura-white) !important;
}

#menu .links a h3 {
    color: var(--sakura-accent) !important;
}

#menu .links a:hover {
    background: var(--sakura-light) !important;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    border: 2px solid var(--sakura-light) !important;
    border-radius: 8px !important;
    background: var(--sakura-white) !important;
    color: var(--sakura-text) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--sakura-accent) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1) !important;
}

/* Avatar Styling */
.author img,
.logo img {
    border: 4px solid var(--sakura-pink) !important;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2) !important;
}

/* ==================== PROFILE HERO SECTION ==================== */

/* Override .post defaults for hero section */
.post.profile-hero-section {
    padding: 0 !important;
    margin: 0 0 3em 0 !important;
    border: 2px solid var(--sakura-pink) !important;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.08) !important;
    background: var(--sakura-white) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
}

.post.profile-hero-section > header {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    width: 100% !important;
    left: 0 !important;
}

/* Video container with 16:10 aspect ratio */
.profile-hero-section .image.featured {
    margin: 0 !important;
    padding-top: 62.5% !important; /* 16:10 ratio */
    height: 0 !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 0 !important;
}

.profile-hero-section .profile-cover-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 1 !important;
}

/* Overlay with profile info */
.profile-hero-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
    padding: 1rem 0;
}

.profile-hero-overlay-inner {
    max-width: 900px;
    width: auto;
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.profile-hero-overlay .author {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.profile-hero-overlay .author img,
.profile-hero-section .profile-hero-overlay .author img,
.post.profile-hero-section .profile-hero-overlay .author img {
    width: 140px !important;
    height: 140px !important;
    border-radius: 50% !important;
    border: 4px solid var(--sakura-pink) !important;
    box-shadow: none !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: block !important;
    min-width: 140px !important;
    min-height: 140px !important;
    max-width: 140px !important;
    max-height: 140px !important;
}

.profile-hero-overlay .title {
    margin: 0;
    padding: 0;
    text-align: center;
}

.profile-hero-section .profile-hero-overlay .title h2 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 2.5rem !important;
    font-weight: 900 !important;
    color: #ff6b9d !important;
    text-shadow: none !important;
}

.profile-hero-overlay .title .handle {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff !important;
    text-shadow: none;
}

.profile-hero-overlay .title .tagline {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: none;
}

.profile-hero-overlay .title .bio {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none;
    max-width: 700px;
}

/* Responsive */
@media screen and (max-width: 980px) {
    .profile-hero-section .image.featured {
        padding-top: 62.5% !important; /* Keep 16:10 ratio */
    }
    
    .profile-hero-overlay {
        padding: 0.75rem 0 !important;
    }
    
    .profile-hero-overlay-inner {
        padding: 0.75rem 1rem !important;
        max-width: 95% !important;
        width: 95% !important;
        gap: 0.4rem !important;
    }
    
    .profile-hero-overlay .author img,
    .profile-hero-section .profile-hero-overlay .author img,
    .post.profile-hero-section .profile-hero-overlay .author img {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px !important;
        min-height: 90px !important;
        max-width: 90px !important;
        max-height: 90px !important;
        border-width: 3px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        flex-shrink: 0 !important;
        display: block !important;
    }
    
    .profile-hero-section .profile-hero-overlay .title h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.2rem !important;
    }
    
    .profile-hero-overlay .title .handle {
        font-size: 0.9rem !important;
        margin-bottom: 0.2rem !important;
    }
    
    .profile-hero-overlay .title .tagline {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
    }
    
    .profile-hero-overlay .title .bio {
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
        max-width: 100% !important;
    }
}

@media screen and (max-width: 736px) {
    .profile-hero-section .image.featured {
        padding-top: 62.5% !important; /* Keep 16:10 ratio */
    }
    
    .profile-hero-overlay {
        align-items: center !important;
        padding: 0.5rem 0 !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    .profile-hero-overlay-inner {
        padding: 0.5rem 0.75rem !important;
        gap: 0.3rem !important;
        max-width: 95% !important;
        width: 95% !important;
    }
    
    .profile-hero-overlay .author img,
    .profile-hero-section .profile-hero-overlay .author img,
    .post.profile-hero-section .profile-hero-overlay .author img {
        width: 70px !important;
        height: 70px !important;
        min-width: 70px !important;
        min-height: 70px !important;
        max-width: 70px !important;
        max-height: 70px !important;
        border-width: 2px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        flex-shrink: 0 !important;
        display: block !important;
    }
    
    .profile-hero-section .profile-hero-overlay .title h2 {
        font-size: 1.15rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.25 !important;
    }
    
    .profile-hero-overlay .title .handle {
        font-size: 0.8rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.2 !important;
    }
    
    .profile-hero-overlay .title .tagline {
        font-size: 0.72rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.2 !important;
    }
    
    .profile-hero-overlay .title .bio {
        font-size: 0.68rem !important;
        line-height: 1.35 !important;
        max-width: 100% !important;
        margin-bottom: 0 !important;
    }
}
        line-height: 1.3;
        max-width: 100%;
        margin-bottom: 0;
    }
}

@media screen and (max-width: 480px) {
    .profile-hero-section .image.featured {
        padding-top: 62.5% !important; /* Keep 16:10 ratio */
    }
    
    .profile-hero-overlay {
        padding: 0.5rem 0;
    }
    
    .profile-hero-overlay-inner {
        padding: 0.4rem 0.5rem;
        gap: 0.2rem;
    }
    
    .profile-hero-overlay .author img {
        width: 50px;
        height: 50px;
        border-width: 2px;
        object-fit: cover;
        flex-shrink: 0;
    }
    
    .profile-hero-section .profile-hero-overlay .title h2 {
        font-size: 0.95rem !important;
        margin-bottom: 0.1rem;
        line-height: 1.1;
    }
    
    .profile-hero-overlay .title .handle {
        font-size: 0.65rem;
        margin-bottom: 0.1rem;
        line-height: 1.1;
    }
    
    .profile-hero-overlay .title .tagline {
        font-size: 0.6rem;
        margin-bottom: 0.1rem;
        line-height: 1.1;
    }
    
    .profile-hero-overlay .title .bio {
        font-size: 0.55rem;
        line-height: 1.2;
        max-width: 100%;
        margin-bottom: 0;
    }
}

/* ==================== END PROFILE HERO ==================== */

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--sakura-light);
}

::-webkit-scrollbar-thumb {
    background: var(--sakura-pink);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sakura-accent);
}

/* ==================== Falling Sakura Petals ==================== */
@keyframes sakura-fall-diagonal {
    0% {
        top: -100px;
        left: 0;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        top: 110vh;
        left: var(--horizontal-distance);
        opacity: 0;
    }
}

@keyframes sakura-sway {
    0%, 100% {
        transform: translateX(0) rotateZ(0deg);
    }
    25% {
        transform: translateX(-30px) rotateZ(120deg);
    }
    50% {
        transform: translateX(20px) rotateZ(-80deg);
    }
    75% {
        transform: translateX(40px) rotateZ(150deg);
    }
}

@keyframes sakura-spin {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(360deg);
    }
}

#sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.sakura-petal-fall {
    position: absolute;
    /* size set inline in JS for variety (small by default) */
    animation: sakura-fall-diagonal linear infinite, sakura-sway ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(255, 183, 197, 0.4));
    will-change: transform;
    backface-visibility: hidden;
    transform-origin: center center;
    contain: layout style paint;
}

.sakura-petal-fall img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Mouse Trail Effect */
@keyframes mouse-trail-fade {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

.sakura-mouse-trail {
    position: absolute;
    background: linear-gradient(135deg, var(--sakura-accent) 0%, var(--sakura-pink) 100%);
    border-radius: 50% 0 50% 0;
    pointer-events: none;
    z-index: 9998;
    animation: mouse-trail-fade 0.8s ease-out forwards;
    box-shadow: 0 0 6px rgba(255, 107, 157, 0.5);
    transform-origin: center center;
    will-change: transform, opacity;
    contain: layout style paint;
}

/* ==================== Click Effect ==================== */
@keyframes click-ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes petal-burst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(360deg) scale(0);
        opacity: 0;
    }
}

.sakura-click-effect {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--sakura-pink);
    border-radius: 50%;
    pointer-events: none;
    animation: click-ripple 0.6s ease-out;
    z-index: 9999;
    margin-left: -20px;
    margin-top: -20px;
}

.sakura-click-petal {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--sakura-accent) 0%, var(--sakura-pink) 100%);
    border-radius: 50% 0 50% 0;
    pointer-events: none;
    animation: petal-burst 1s ease-out forwards;
    z-index: 9998;
    margin-left: -6px;
    margin-top: -6px;
    box-shadow: 0 0 8px rgba(255, 107, 157, 0.6);
}

/* ==================== Cherry Blossom Branches ==================== */
@keyframes branch-sway {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

@keyframes branch-sway-reverse {
    0%, 100% {
        transform: rotate(0deg) scaleX(-1);
    }
    50% {
        transform: rotate(-2deg) scaleX(-1);
    }
}

@keyframes branch-sway-gentle {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(1.5deg);
    }
}

.sakura-branch {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}

.sakura-branch img {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(139, 69, 19, 0.25));
}

.sakura-branch-top-left {
    top: -30px;
    left: -30px;
    width: 500px;
    height: auto;
    transform-origin: top left;
    animation: branch-sway 6s ease-in-out infinite;
}

.sakura-branch-top-right {
    top: -30px;
    right: -30px;
    width: 500px;
    height: auto;
    transform-origin: top right;
    animation: branch-sway 6.5s ease-in-out infinite;
}

.sakura-branch-bottom-right {
    bottom: -30px;
    right: -30px;
    width: 450px;
    height: auto;
    transform-origin: bottom right;
    animation: branch-sway 7s ease-in-out infinite;
}

.sakura-branch-bottom-left {
    bottom: -30px;
    left: -30px;
    width: 400px;
    height: auto;
    transform-origin: bottom left;
    animation: branch-sway 7.5s ease-in-out infinite;
}

.sakura-branch-middle-left {
    top: 40%;
    left: -20px;
    width: 280px;
    height: auto;
    transform-origin: center left;
    animation: branch-sway-gentle 8s ease-in-out infinite;
}

/* Hide branches on mobile and tablets */
@media screen and (max-width: 980px) {
    /* hide large decorative branches except the top-left which we keep smaller */
    .sakura-branch {
        display: none;
    }
    .sakura-branch-top-left {
        display: block;
        top: -10px;
        left: -8px;
        width: 280px !important; /* Smaller branch at 980px */
        opacity: 0.85;
        transform-origin: top left;
        animation: branch-sway 6.5s ease-in-out infinite;
        pointer-events: none;
        z-index: 1;
    }

    .sakura-petal-fall {
        width: 10px;
        height: 10px;
    }

    .sakura-mouse-trail {
        display: none;
    }

    /* Profile hero responsive fixes: center content and correct avatar/cover sizing */
    .profile-hero-section header > div {
        margin-top: 0 !important;
        position: relative;
        z-index: 10;
        padding-top: 0.5rem;
        display: flex;
        flex-direction: column;
        align-items: center; /* ensure centered */
        justify-content: flex-start;
        width: 100%;
        box-sizing: border-box;
    }
    .profile-hero-section .author img {
        width: 120px !important;
        height: 120px !important;
        max-width: 40vw !important;
    }
    .profile-hero-section .title {
        padding: 0 1rem 1rem !important;
        text-align: center !important;
        width: 100%;
        max-width: 640px;
    }
    .profile-hero-section .image.featured img {
        height: 220px !important;
        object-fit: cover !important;
        width: 100%;

    /* Profile cover video: maintain 16:9 aspect ratio and cover the area */
    .profile-hero-section .image.featured {
        position: relative;
        padding-top: 56.25%; /* 16:9 ratio */
        overflow: hidden;
    }

    .profile-hero-section .image.featured .profile-cover-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Ensure the profile box height adapts to include the 16:9 cover area */
    .profile-hero-section {
        display: block;
    }
    }
}

/* Specific overrides to make the profile hero behave like other posts on mobile */
@media screen and (max-width: 980px) {
    .profile-hero-section {
        left: 0 !important;
        width: 100% !important;
        padding: 1.5em 1.5em 1em 1.5em !important;
        box-sizing: border-box;
    }
    .profile-hero-section > header {
        left: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .profile-hero-section .image.featured {
        margin-left: 0 !important;
        width: 100% !important;
        height: auto !important;
    }
    .profile-hero-section .title {
        padding: 1rem 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
}

/* Icon Colors */
.icon {
    color: var(--sakura-accent) !important;
}

.icon:hover {
    color: var(--sakura-dark) !important;
}

/* Search */
#search input {
    background: var(--sakura-white) !important;
    border-color: var(--sakura-light) !important;
    transition: border-color 0.2s ease;
}

#search input:focus {
    border-color: var(--sakura-accent) !important;
}

/* Stats & Meta */
.stats li a {
    color: var(--sakura-text-light) !important;
}

.stats li a:hover {
    color: var(--sakura-accent) !important;
}

/* Responsive adjustments */
@media screen and (max-width: 1280px) {
    #sidebar {
        border-left: none !important;
        border-top: 2px solid var(--sakura-light) !important;
    }
}

/* Selection */
::selection {
    background: var(--sakura-pink);
    color: var(--sakura-white);
}

::-moz-selection {
    background: var(--sakura-pink);
    color: var(--sakura-white);
}
