/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    /* Default: Tech Blue Style */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-color: #4a90e2;
    --accent-hover: #357abd;
    --border-color: #e1e4e8;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Spotlight Effect */
    --cursor-x: 50vw;
    --cursor-y: 50vh;
    --spotlight-color: rgba(74, 144, 226, 0.15);
    --spotlight-secondary: rgba(225, 240, 255, 0.15); /* Light Blue */
    
    /* Typography */
    --font-main: 'Inter', 'Noto Sans SC', sans-serif;
    --font-code: 'Fira Code', monospace;
    
    /* Layout */
    --container-width: 1100px;
    --header-height: 60px;
    --radius: 24px;
    
    /* Interactive Shadows */
    --shadow-active: rgba(74, 144, 226, 0.4);
}

/* Cute Style Override */
body.style-cute {
    /* Colors - Light Theme */
    --bg-color: #fff0f5; /* Lavender Blush - Warmer & Cuter */
    --card-bg: #ffffff;
    --text-primary: #4a4a4a; /* Softer Black */
    --text-secondary: #7a7a7a;
    --accent-color: #ff8fa3; /* Soft Pink/Coral */
    --accent-hover: #ff6b85;
    --border-color: #f0e6e8;
    --shadow: 0 8px 20px rgba(255, 143, 163, 0.15); /* Pinkish soft shadow */
    --shadow-hover: 0 12px 25px rgba(255, 143, 163, 0.25);
    
    /* Spotlight Effect */
    --spotlight-color: rgba(255, 182, 193, 0.25); /* Light Pink */
    --spotlight-secondary: rgba(255, 228, 225, 0.15); /* Misty Rose */
    
    /* Interactive Shadows */
    --shadow-active: rgba(255, 143, 163, 0.4);
}

/* Dark Theme Variables (Default Blue) */
body.dark-theme {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-color: #64b5f6;
    --accent-hover: #90caf9;
    --border-color: #404040;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.4);
    --spotlight-color: rgba(100, 181, 246, 0.1);
}

/* Dark Theme Variables (Cute Pink) */
body.style-cute.dark-theme {
    --bg-color: #2b2024; /* Dark warm brown/grey */
    --card-bg: #362b30;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --accent-color: #ffb7b2; /* Pastel Pink */
    --accent-hover: #ffdac1;
    --border-color: #4a3b40;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 25px rgba(0, 0, 0, 0.4);
    --spotlight-color: rgba(255, 105, 180, 0.15); /* Hot Pink */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative; /* For spotlight positioning */
    cursor: none; /* Hide default cursor */
}

/* Hide default cursor on interactive elements */
a, button, input, select, textarea, .tag-cloud-item, .nav-btn {
    cursor: none !important;
}

/* Spotlight Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(
        circle 350px at var(--cursor-x) var(--cursor-y), 
        var(--spotlight-color),
        var(--spotlight-secondary) 40%,
        transparent 70%
    );
    z-index: 9999; /* Overlay on top but pointer-events none */
    mix-blend-mode: multiply; /* Better blending for light mode */
}

body.dark-theme::before {
    mix-blend-mode: screen; /* Better blending for dark mode */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

/* =========================================
   2. Layout & Components
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 500;
}

.nav-links a.active {
    color: var(--accent-color);
}

#style-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

#style-toggle:hover {
    background-color: var(--bg-color);
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

#theme-toggle:hover {
    background-color: var(--bg-color);
}

/* Main Layout */
.main-content {
    padding: 40px 0;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    min-height: calc(100vh - var(--header-height) - 60px); /* Footer height approx */
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
}

/* Search */
.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-primary);
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent-color);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud-item {
    background: var(--bg-color);
    padding: 8px 16px; /* Larger padding */
    border-radius: 50px; /* Fully rounded pill */
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid transparent;
}

.tag-cloud-item:hover, .tag-cloud-item.active {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1) rotate(-2deg); /* Playful tilt */
    box-shadow: 0 4px 10px var(--shadow-active);
}

/* Post List */
.post-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 2px solid transparent; /* Prepare for border transition */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.post-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.post-meta {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    align-items: center;
}

.tag {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.post-summary {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.read-more {
    color: var(--accent-color);
    font-weight: 600;
}

/* Post Detail */
.post-header {
    margin-bottom: 40px;
    text-align: center;
}

.post-title-large {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.post-body {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 1.1rem;
}

/* Typography for Post Body */
.typography h2 { margin: 1.5em 0 0.8em; font-size: 1.8rem; }
.typography h3 { margin: 1.2em 0 0.6em; font-size: 1.4rem; }
.typography p { margin-bottom: 1.2em; }
.typography code { 
    background: var(--bg-color); 
    padding: 2px 5px; 
    border-radius: 4px; 
    font-family: var(--font-code);
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.nav-btn {
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-weight: 600;
}

/* About Page */
.about-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.skill-item {
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    border-left: 3px solid var(--accent-color);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    border: none;
    font-size: 1.2rem;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Particle Effect - Cute Emojis */
.cursor-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    font-size: 14px;
    animation: particleAnim 1s forwards;
    user-select: none;
}

@keyframes particleAnim {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(0, 30px) scale(0.5) rotate(180deg);
    }
}

/* Custom Cursor - Cute Style */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 24px;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, font-size 0.2s;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15)); /* Soft shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* Hover State - Cat Face */
.custom-cursor.hover {
    font-size: 32px;
    transform: translate(-50%, -50%) rotate(-15deg); /* Tilt head */
}

/* Remove pseudo-elements from previous styles */
.custom-cursor::before,
.custom-cursor::after {
    display: none;
}

/* =========================================
   3. Responsive Design
   ========================================= */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1; /* Sidebar on top or bottom? Usually bottom on mobile, but search is useful on top. Let's keep it simple. */
        order: 1;
    }

    .post-title-large {
        font-size: 1.8rem;
    }
    
    .post-body {
        padding: 20px;
    }
}
