/*
 * TinyBlue.dev - Enhanced Stylesheet v2.0
 * Modern, accessible, and performant
 */

:root {
    /* Color Palette */
    --primary-color: #00d4ff;
    --primary-dark: #0099cc;
    --primary-light: #00e5ff;
    --secondary-color: #0066ff;
    --bg-dark: #000000;
    --bg-gradient-start: #0a0a0a;
    --bg-gradient-end: #001830;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-tertiary: rgba(255, 255, 255, 0.5);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 25px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 212, 255, 0.1);
    --shadow-md: 0 8px 24px rgba(0, 212, 255, 0.2);
    --shadow-lg: 0 16px 48px rgba(0, 212, 255, 0.3);
    --shadow-glow: 0 0 20px var(--primary-color);

    /* Animation */
    --animation-duration: 0.6s;
    --animation-delay: 0.1s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(45deg, var(--bg-gradient-start), var(--bg-gradient-end));
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-conic-gradient(
        from 0deg at 50% 50%,
        rgba(0, 212, 255, 0) 0deg,
        rgba(0, 212, 255, 0.07) 20deg,
        rgba(0, 212, 255, 0) 40deg
    );
    animation: rotate 60s linear infinite;
    will-change: transform;
}

.bg-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

@keyframes pulse-bg {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 4rem;
}

.glitch {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    text-shadow:
        0 0 10px #00d4ff,
        0 0 20px #00d4ff,
        0 0 30px #00d4ff;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    margin-top: 2rem;
    font-size: clamp(1rem, 3vw, 1.5rem);
    letter-spacing: 0.3em;
    opacity: 0.8;
    text-transform: uppercase;
    animation: fadeInUp 1s ease-out 0.5s both;
}

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

/* Navigation */
.nav-menu {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 25px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Sections */
.portfolio-section, .services-section, .contact-section {
    margin: 5rem 0;
    animation: fadeInUp 1s ease-out 1.2s both;
    width: 100%;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px #00d4ff;
}

/* Project Filter/Search */
.project-filter {
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    text-align: center;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    margin-bottom: var(--spacing-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: var(--shadow-md);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.filter-tags {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.5rem 1.2rem;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-tag:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

.filter-tag.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.filter-tag:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
    font-size: 1.1rem;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.project-card {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
    filter: blur(10px);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--transition-slow);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 212, 255, 0.5);
}

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

.project-card:hover::after {
    left: 100%;
}

.project-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.project-card:active {
    transform: translateY(-8px) scale(1.01);
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.project-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #00d4ff;
}

.project-desc {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    opacity: 0.9;
}

.project-tech {
    color: #00d4ff;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Tech Grid */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.tech-card {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 2rem;
    text-align: center;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.tech-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.tech-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #00d4ff, #0066ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tech-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #00d4ff;
}

.tech-desc {
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.contact-card {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #00d4ff;
}

.contact-desc {
    opacity: 0.8;
    line-height: 1.5;
}

/* Server Time Display */
.server-time {
    position: fixed;
    top: 2rem;
    right: 2rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    opacity: 0.5;
    letter-spacing: 0.1em;
    animation: fadeInUp 1s ease-out 1.5s both;
}

.admin-link {
    margin-top: 10px;
    opacity: 0.3;
    font-size: 0.7rem;
}

.admin-link a {
    color: inherit;
    text-decoration: none;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.6);
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-md);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 1.5rem;
    transition: transform var(--transition-normal);
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-gradient-start: #f0f4f8;
    --bg-gradient-end: #e1e8ed;
    --text-primary: #1a1a1a;
    --text-secondary: rgba(0, 0, 0, 0.8);
    --text-tertiary: rgba(0, 0, 0, 0.5);
    --primary-color: #0099cc;
    --primary-dark: #006699;
    --shadow-sm: 0 2px 8px rgba(0, 153, 204, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 153, 204, 0.25);
    --shadow-lg: 0 16px 48px rgba(0, 153, 204, 0.35);
}

[data-theme="light"] .bg-animation {
    background: linear-gradient(135deg, #e1f5fe, #b3e5fc, #81d4fa);
}

[data-theme="light"] .project-card,
[data-theme="light"] .tech-card,
[data-theme="light"] .contact-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 153, 204, 0.3);
}

[data-theme="light"] .nav-link,
[data-theme="light"] .home-link {
    color: var(--text-primary);
    border-color: rgba(0, 153, 204, 0.3);
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--animation-duration) ease,
                transform var(--animation-duration) ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.project-card.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.project-card.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.project-card.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .project-grid, .tech-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .server-time {
        top: 1rem;
        right: 1rem;
        font-size: 0.8rem;
    }

    .theme-toggle {
        top: 1rem;
        left: 1rem;
        width: 45px;
        height: 45px;
    }

    .container {
        padding: 1rem;
    }
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    color: #00d4ff;
    text-shadow: 0 0 30px #00d4ff;
}

.error-message {
    font-size: 1.5rem;
    margin: 2rem 0;
    opacity: 0.8;
}

.home-link {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 25px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.home-link:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.7);
    transform: translateY(-2px);
}