:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff6b9d;
    --accent-color: #ffd93d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
    --gradient-1: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-2: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
}

[data-theme="light"] {
    --primary-color: #0066cc;
    --secondary-color: #cc1e66;
    --accent-color: #cc9900;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 30px rgba(0, 102, 204, 0.3);
    --gradient-1: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-2: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
}

[data-theme="mono"] {
    --primary-color: #ffffff;
    --secondary-color: #888888;
    --accent-color: #cccccc;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-card: rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.2);
    --gradient-1: linear-gradient(135deg, #ffffff, #888888);
    --gradient-2: linear-gradient(45deg, #888888, #cccccc);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* Enhanced Particle System */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.8;
    animation: float 20s infinite linear;
}

.particle:nth-child(odd) {
    background: var(--secondary-color);
    animation: floatReverse 15s infinite linear;
}

.particle:nth-child(3n) {
    background: var(--accent-color);
    animation: pulse 3s infinite ease-in-out;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatReverse {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) rotate(-360deg);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.4;
    }
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Header */
.header {
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease;
}

.main-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    background: var(--gradient-1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: var(--shadow-glow);
    animation: glow 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
    animation: fadeIn 1s ease 0.5s both;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px var(--primary-color));
    }
    to {
        filter: drop-shadow(0 0 30px var(--secondary-color));
    }
}

/* Projects Section */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    width: 100%;
    max-width: 800px;
}

.project-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: -1;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        var(--shadow-glow);
}

.project-card:hover::before {
    left: 0;
    opacity: 0.1;
}

.project-card:nth-child(2)::before {
    background: var(--gradient-2);
}

.project-card:nth-child(3)::before {
    background: linear-gradient(45deg, #ff6b9d, #ffd93d);
}

.cat-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.project-card:hover .cat-button {
    color: var(--primary-color);
    text-shadow: 0 0 10px currentColor;
}

.project-card a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    transition: all 0.3s ease;
}

.project-card:hover a {
    color: var(--primary-color);
    text-shadow: 0 0 10px currentColor;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1000;
}

.theme-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.theme-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.theme-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Fix button text visibility for each theme */
[data-theme="dark"] .theme-btn {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .theme-btn {
    color: black;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

[data-theme="mono"] .theme-btn {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover states with proper contrast */
[data-theme="dark"] .theme-btn:hover {
    color: white;
}

[data-theme="light"] .theme-btn:hover {
    color: white;
}

[data-theme="mono"] .theme-btn:hover {
    color: black;
}

/* Contact Section */
.contact {
    margin: 3rem 0 2rem;
    animation: fadeIn 1s ease 1s both;
}

.contact a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.contact a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: all 0.4s ease;
    z-index: -1;
}

.contact a:hover {
    color: white;
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

.contact a:hover::before {
    left: 0;
}

/* Footer */
footer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: auto;
    animation: fadeIn 1s ease 1.5s both;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .theme-switcher {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        top: auto;
        flex-direction: column;
    }

    .container {
        padding: 1rem;
    }

    .projects {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: var(--bg-primary);
}

/* Cat overlay styles */
.cat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.cat-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

.cat-image {
    max-width: 80%;
    max-height: 80%;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

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