/* ============================================
   CSS NORMALIZE & RESET
   ============================================ */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section, summary {
    display: block;
}

audio, canvas, video {
    display: inline-block;
}

audio:not([controls]) {
    display: none;
    height: 0;
}

[hidden] {
    display: none;
}

html {
    font-family: sans-serif;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

a:focus {
    outline: 2px solid #00d9ff;
    outline-offset: 2px;
}

a:active, a:hover {
    outline: 0;
}

abbr[title] {
    border-bottom: 1px dotted;
}

b, strong {
    font-weight: 700;
}

dfn {
    font-style: italic;
}

mark {
    background: #00d9ff;
    color: #000;
}

code, kbd, pre, samp {
    font-family: monospace, serif;
    font-size: 1em;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

q {
    quotes: "\201C" "\201D" "\2018" "\2019";
}

small {
    font-size: 80%;
}

sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

img {
    border: 0;
    max-width: 100%;
    height: auto;
}

svg:not(:root) {
    overflow: hidden;
}

fieldset {
    border: 1px solid silver;
    margin: 0 2px;
    padding: 0.35em 0.625em 0.75em;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    margin: 0;
}

button, input {
    line-height: normal;
}

button, html input[type="button"], input[type="reset"], input[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
}

button[disabled], input[disabled] {
    cursor: default;
}

input[type="checkbox"], input[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

input[type="search"] {
    -webkit-appearance: textfield;
    box-sizing: content-box;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

textarea {
    overflow: auto;
    vertical-align: top;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

body, figure {
    margin: 0;
}

legend, button::-moz-focus-inner, input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* ============================================
   CSS CUSTOM PROPERTIES (THEME COLORS)
   ============================================ */
:root {
    /* Colors extracted from the lake background */
    --primary-teal: #00d9ff;
    --secondary-cyan: #00ffcc;
    --accent-green: #00ff88;
    --dark-teal: #0a4d5c;
    --deep-blue: #0a2533;
    --forest-green: #1a4d3e;
    
    /* UI Colors */
    --text-primary: #e8f9ff;
    --text-secondary: #a0e7f0;
    --text-muted: #6b9aa8;
    
    /* Card & Background */
    --card-bg: rgba(10, 45, 51, 0.75);
    --card-bg-hover: rgba(10, 77, 92, 0.85);
    --card-border: rgba(0, 217, 255, 0.2);
    --card-border-hover: rgba(0, 217, 255, 0.5);
    
    /* Glow Effects */
    --glow-teal: rgba(0, 217, 255, 0.5);
    --glow-cyan: rgba(0, 255, 204, 0.4);
    --glow-green: rgba(0, 255, 136, 0.3);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d9ff 0%, #00ffcc 100%);
    --gradient-accent: linear-gradient(135deg, #00ffcc 0%, #00ff88 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(10, 45, 51, 0) 0%, rgba(10, 45, 51, 0.9) 100%);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    background-image: url(../../Assets/pictures/lake-background2024.png);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    background-color: #0a2533;
    position: relative;
}

/* Background overlay for better text readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(10, 37, 51, 0.3) 0%, 
        rgba(10, 37, 51, 0.6) 50%, 
        rgba(10, 37, 51, 0.8) 100%);
    pointer-events: none;
    z-index: 0;
}

body, html {
    padding: 0;
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a img {
    outline: none;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ============================================
   LAYOUT
   ============================================ */
.flex-wrapper {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   HEADER SECTION
   ============================================ */
.site-header {
    width: 100%;
    text-align: center;
    padding: 40px 20px 20px;
    position: relative;
    margin-bottom: 20px;
}

h1 {
    font-family: 'Orbitron', 'Bungee Shade', cursive, sans-serif;
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    margin: 0;
    padding: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    animation: titleGlow 4s ease-in-out infinite alternate;
    text-shadow: 0 0 30px var(--glow-teal);
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 10px var(--glow-teal)) 
                drop-shadow(0 0 20px var(--glow-teal));
    }
    50% {
        filter: drop-shadow(0 0 20px var(--glow-cyan)) 
                drop-shadow(0 0 40px var(--glow-cyan));
    }
    100% {
        filter: drop-shadow(0 0 15px var(--glow-green)) 
                drop-shadow(0 0 30px var(--glow-green));
    }
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 100%;
    background: radial-gradient(ellipse, var(--glow-teal) 0%, transparent 70%);
    opacity: 0.2;
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   SOCIAL MEDIA LINKS
   ============================================ */
.socials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
}

.socials ul {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.media-buttons {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-buttons a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.media-buttons:hover a {
    background: var(--card-bg-hover);
    border-color: var(--card-border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--glow-teal);
}

.social {
    font-size: 24px;
    color: var(--primary-teal);
    transition: all 0.3s ease;
}

.media-buttons:hover .social {
    color: var(--secondary-cyan);
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 8px currentColor);
}

.social-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.media-buttons:hover .social-label {
    opacity: 1;
    max-width: 100px;
}

/* ============================================
   TYPEWRITER TEXT
   ============================================ */
.typewriter-text {
    width: 100%;
    min-height: 60px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 600;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.8;
    font-family: 'Rajdhani', sans-serif;
}

/* ============================================
   PROJECTS GRID
   ============================================ */
.projectsUno {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    width: 100%;
    padding: 20px 0;
}

.project-link {
    display: block;
    height: 100%;
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.screenshot-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.screenshot-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.screenshot-group:hover {
    transform: translateY(-8px);
    background: var(--card-bg-hover);
    border-color: var(--card-border-hover);
    box-shadow: 0 12px 30px var(--glow-teal);
}

.screenshot-group:hover::before {
    transform: scaleX(1);
}

/* Image Container */
.image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--deep-blue);
}

.screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-overlay);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.screenshot-group:hover .screenshot {
    transform: scale(1.05);
}

.screenshot-group:hover .image-overlay {
    opacity: 0.6;
}

/* Card Content */
.pic-caption {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.pic-caption h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.screenshot-group:hover .pic-caption h2 {
    transform: translateX(5px);
}

.pic-caption p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

/* Technology Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-teal);
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.screenshot-group:hover .tag {
    background: rgba(0, 217, 255, 0.2);
    border-color: var(--primary-teal);
    transform: translateY(-2px);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--deep-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--dark-teal);
    border-radius: 10px;
    border: 2px solid var(--deep-blue);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-teal);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media only screen and (max-width: 768px) {
    .flex-wrapper {
        padding: 15px;
    }

    .site-header {
        padding: 30px 15px 15px;
    }

    h1 {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    .projectsUno {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .socials ul {
        gap: 10px;
    }

    .media-buttons a {
        padding: 10px 14px;
    }

    .social-label {
        display: none;
    }

    .typewriter-text {
        font-size: 1rem;
        padding: 15px;
        min-height: 50px;
    }
}

@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .projectsUno {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media only screen and (min-width: 1400px) {
    .projectsUno {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--primary-teal);
    outline-offset: 3px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --card-border: rgba(0, 217, 255, 0.8);
        --text-primary: #ffffff;
        --text-secondary: #e0e0e0;
    }
}