/* ==========================================================================
   TechMelon Portfolio Design System
   ========================================================================== */

:root {
    --bg-main: #060913;
    --bg-card: rgba(255, 255, 255, 0.02);
    --border-card: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(16, 185, 129, 0.3);
    
    /* Harmonious Melon Color Palette */
    --melon: #10B981;
    --melon-hover: #059669;
    --melon-rgb: 16, 185, 129;
    --melon-glow: rgba(16, 185, 129, 0.15);
    
    /* UI Accent Colors */
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --blue: #3B82F6;
    --blue-glow: rgba(59, 130, 246, 0.15);
    --orange: #F97316;
    --green: #10B981;
    
    --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

/* ==========================================================================
   Ambient Background Glow Blobs
   ========================================================================== */

.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    mix-blend-mode: screen;
    animation: drift 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--melon) 0%, rgba(0,0,0,0) 70%);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--blue) 0%, rgba(0,0,0,0) 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #8B5CF6 0%, rgba(0,0,0,0) 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
    animation-duration: 18s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(40px, -60px) scale(1.1) rotate(180deg);
        opacity: 0.2;
    }
    100% {
        transform: translate(-20px, 20px) scale(0.95) rotate(360deg);
    }
}

/* ==========================================================================
   Layout Container
   ========================================================================== */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.header {
    text-align: center;
    margin-bottom: 4rem;
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
}

.avatar-emoji {
    font-size: 3.5rem;
    z-index: 2;
}

.avatar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--melon);
    box-shadow: 0 0 20px var(--melon-glow);
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Language Switcher */
.lang-switch-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 100;
    backdrop-filter: blur(8px);
}

.lang-switch-btn:hover {
    background: var(--melon-glow);
    color: var(--melon);
    border-color: var(--melon);
}

.title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #FFF 30%, var(--melon) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.bio {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Social Buttons */
.link-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.link-btn:hover {
    color: var(--melon);
    background: var(--melon-glow);
    border-color: var(--melon);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.link-btn i, .link-btn svg {
    width: 20px;
    height: 20px;
}

/* Premium Section Styles & Shimmer Effects */
@keyframes gold-pulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 215, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 215, 0, 0.6) !important;
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }
}

.premium-card {
    border: 1px solid rgba(255, 215, 0, 0.25) !important;
    animation: gold-pulse 5s infinite ease-in-out;
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.18) 0%, transparent 60%);
    opacity: 0.3; /* Subtle glow even without hover */
    transition: opacity 0.5s;
    pointer-events: none;
}

.premium-card:hover::before {
    opacity: 1;
}

.premium-card:hover {
    border-color: rgba(255, 215, 0, 1) !important;
    box-shadow: 0 15px 45px rgba(255, 215, 0, 0.3) !important;
    transform: translateY(-6px);
}

.shimmer-line {
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 215, 0, 0.18) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shimmer-swipe 7s infinite ease-in-out;
    pointer-events: none;
}

@keyframes shimmer-swipe {
    0% { left: -150%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

.text-gold {
    color: #ffd700 !important;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.bg-gold {
    background: rgba(255, 215, 0, 0.12) !important;
    color: #ffd700 !important;
}

.bg-github {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* Image Logos Support inside icon bg boxes */
.app-icon-bg img, .item-icon-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.app-icon-bg, .item-icon-bg {
    overflow: hidden; /* Ensure image border-radius is respected */
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.col-span-2 {
    grid-column: span 2;
}

.grid-section {
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.section-icon {
    width: 22px;
    height: 22px;
}

.text-melon { color: var(--melon); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }

/* ==========================================================================
   Glassmorphism Cards
   ========================================================================== */

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Hover glow effect (applied dynamically or on card hover) */
.hover-glow:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.1),
                0 8px 10px -6px rgba(16, 185, 129, 0.1);
}

/* ==========================================================================
   Featured Products Cards
   ========================================================================== */

.product-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-icon-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.app-icon-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.bg-orange {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--orange);
}

.bg-blue {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue);
}

.card-icon-title h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.card-actions {
    margin-top: auto;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    background: var(--melon);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.primary-btn:hover {
    background: var(--melon-hover);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.primary-btn i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Links List System
   ========================================================================== */

.link-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.item-icon-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.bg-telegram {
    background: rgba(36, 129, 204, 0.1);
    border: 1px solid rgba(36, 129, 204, 0.2);
    color: #2481CC;
}

.bg-feishu {
    background: rgba(20, 86, 240, 0.1);
    border: 1px solid rgba(20, 86, 240, 0.2);
    color: #1456F0;
}

.item-info {
    flex-grow: 1;
    margin-right: 1rem;
}

.item-info h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.item-info p {
    color: var(--text-secondary);
    font-size: 0.775rem;
}

.arrow-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.list-item:hover .arrow-icon {
    color: var(--melon);
    transform: translateX(3px);
}

.join-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--melon);
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: var(--transition-smooth);
    white-space: nowrap;
    flex-shrink: 0;
}

.list-item:hover .join-badge {
    background: var(--melon);
    color: #fff;
}

.cursor-pointer {
    cursor: pointer;
}

/* ==========================================================================
   Open Source Projects Section
   ========================================================================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.folder-icon {
    width: 24px;
    height: 24px;
    color: var(--melon);
}

.github-link {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.github-link:hover {
    color: #fff;
    transform: scale(1.1);
}

.project-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.775rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.lang {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bg-go { background-color: #00ADD8; }
.bg-python { background-color: #3572A5; }
.bg-ts { background-color: #3178C6; }

.stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stars i {
    width: 12px;
    height: 12px;
    color: #EAB308;
    fill: #EAB308;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    margin-top: 5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.hidden {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal {
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-card);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

.qr-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-container img {
    max-width: 100%;
    height: auto;
}

.qr-glow-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.1) inset;
    pointer-events: none;
}

.modal-tip {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-card);
}

.w-full {
    width: 100%;
}

/* ==========================================================================
   Toasts (Alert Alerts)
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    transition: var(--transition-smooth);
    animation: slideUpToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpToast {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-up {
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(var(--delay) * 0.15s);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Responsive Queries
   ========================================================================== */

@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .col-span-2 {
        grid-column: span 1;
    }
    
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 2rem 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .product-cards {
        grid-template-columns: 1fr;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Collapsible Container Styles
   ========================================================================== */
.collapse-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.collapse-container.expanded {
    max-height: 700px; /* High enough to hold 4 cards */
    margin-top: 1rem; /* Add spacing when expanded */
}

.collapse-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(16, 185, 129, 0.2);
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 0.75rem;
    outline: none;
}

.collapse-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.05);
    color: var(--melon);
    border-color: var(--melon);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.toggle-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-toggle-btn.active .toggle-arrow {
    transform: rotate(180deg);
}
