/* ============================================
   Student Portfolio - Main Stylesheet
   Created: 07.10.2025
   ============================================ */

/* ============================================
   CSS Variables - Color Palette
   ============================================ */
:root {
    /* Phthalo-green inspired color palette */
    --bg: #0b1f1a;              /* Main background color */
    --panel: #0e2721;            /* Panel/card background */
    --text: #e5e7eb;             /* Primary text color */
    --muted: #a0b1ad;            /* Secondary/muted text */
    --accent: #00a676;            /* Primary accent green */
    --accent-2: #0e9f6e;         /* Secondary accent green */
    --border: #143a32;            /* Border color */
}

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

/* Normalize box model */
* { 
    box-sizing: border-box; 
}

html { 
    scroll-behavior: smooth;
}

html, body { 
    height: 100%; 
}

/* Base page styling */
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans";
    background: 
        radial-gradient(1200px 600px at 10% -10%, rgba(14,159,110,0.18), transparent 60%),
        radial-gradient(1000px 500px at 110% 10%, rgba(0,166,118,0.14), transparent 60%),
        var(--bg);
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text);
    line-height: 1.6;
}

/* Link styles */
a.nav-link { 
    color: var(--accent); 
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a.nav-link:hover { 
    text-decoration: underline;
    color: var(--accent-2);
}

/* Navigation links in header should use --text color */
nav a.nav-link,
header nav a.nav-link {
    color: var(--text);
}

nav a.nav-link:hover,
header nav a.nav-link:hover {
    color: var(--text);
    opacity: 1;
}

/* Link underline animation */
a.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--accent);
    transition: width 0.3s ease;
}

a.nav-link:hover::after {
    width: 100%;
}

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

/* Main page content wrapper */
.container { 
    max-width: 960px; 
    margin: 0 auto; 
    padding: 24px; 
}

/* 
 * DESKTOP CONTAINER WIDTH INCREASE:
 * 
 * Increased container max-width from 960px to 1100px on screens 1024px+
 * to provide more space for navigation items and prevent wrapping.
 * This works in conjunction with the brand and nav flex fixes above.
 */
@media (min-width: 1024px) {
    .container {
        max-width: 1100px;
    }
}

/* Mobile container padding */
@media (max-width: 768px) {
    .container { 
        padding: 16px; 
    }
}

/* ============================================
   Header & Navigation
   ============================================ */

/* Sticky header container */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    backdrop-filter: blur(6px);
    background: linear-gradient(to bottom, #0e2721e0, #0b1f1aa6);
    z-index: 10;
    opacity: 0;
    transform: translateY(-100%);
    animation: slideDown 0.6s ease-out forwards;
}

/* Header slide down animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Desktop header - ensure proper spacing */
@media (min-width: 769px) {
    header {
        flex-wrap: nowrap;
        gap: 24px; /* Increased from 16px for better spacing between brand and nav */
    }
    
    /* Hide hamburger menu on desktop - navigation links are visible */
    header .menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* 
     * DESKTOP MENU ALIGNMENT FIX:
     * 
     * Problem: Brand section with flex: 1 was taking too much space, causing
     * navigation items to wrap or become misaligned on desktop screens.
     * 
     * Solution:
     * - Changed brand from flex: 1 to flex: 0 1 auto to prevent it from
     *   consuming all available space
     * - Added min-width: 0 to allow proper text truncation if needed
     * - This ensures navigation has adequate space and stays on one line
     */
    .brand {
        flex: 0 1 auto;
        min-width: 0;
        max-width: none;
    }
}

/* Mobile header adjustments */
@media (max-width: 768px) {
    header {
        flex-wrap: nowrap;
        gap: 12px;
        padding: 10px 0 12px;
        position: relative;
    }
    
    .brand {
        order: 1;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    /* Nav is hidden in header on mobile - handled by the slide-out menu rules below */
}

/* Branding section: avatar/logo + name + role */
.brand { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 1;
}

@media (max-width: 768px) {
    .brand {
        gap: 10px;
    }
}

/* Avatar with initials (circular badge) */
.avatar {
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    color: #0b1020; 
    font-weight: 800;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}
/* Avatar container for logo images */
.avatar-logo {
    width: 50px; 
    height: 50px; 
    border-radius: 50%;
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Logo image inside avatar container */
.avatar-logo img {
    width: 110%;
    height: 110%;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

/* Logo hover effect */
.avatar-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.avatar-logo:hover img {
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .avatar-logo {
        width: 44px;
        height: 44px;
        margin-right: 10px;
    }
}
/* ============================================
   Hamburger Menu Toggle Button
   ============================================ */

/* 
 * ISSUE FIXED (Mobile Burger Menu Visibility):
 * 
 * Problem: The burger menu button was not visible on mobile devices.
 * 
 * Root Cause:
 * - The default state had visibility: hidden and opacity: 0, which combined
 *   with display: none created a conflict
 * - The mobile media query wasn't using the same specificity as the desktop
 *   query (header .menu-toggle), causing override issues
 * - Missing pointer-events: auto on mobile meant the button wasn't clickable
 *   even when visible
 * 
 * Solution:
 * - Removed unnecessary visibility and opacity from default state (display: none
 *   is sufficient)
 * - Added header .menu-toggle selector to mobile query for proper specificity
 * - Added pointer-events: auto !important to ensure button is clickable on mobile
 * - Used !important flags consistently to override desktop styles
 * 
 * Date Fixed: 2025
 */

/* Hamburger menu button - hidden by default, shown only on mobile */
.menu-toggle {
    display: none; /* Hidden by default (desktop) */
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    gap: 5px;
    position: relative;
    margin: 0;
    flex-shrink: 0;
}

/* Show hamburger menu on mobile devices */
@media screen and (max-width: 768px) {
    header .menu-toggle,
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        order: 2;
        margin-left: auto;
        pointer-events: auto !important;
    }
}

/* Explicitly hide hamburger menu on desktop */
@media screen and (min-width: 769px) {
    header .menu-toggle,
    .menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Hamburger menu icon lines */
.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #e5e7eb; /* Fallback color */
    background: var(--text, #e5e7eb); /* Uses CSS variable with fallback */
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
    flex-shrink: 0;
    opacity: 1;
    visibility: visible;
}

/* Hamburger to X animation - top line */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

/* Hamburger to X animation - middle line (fades out) */
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

/* Hamburger to X animation - bottom line */
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Hover effect on hamburger icon */
.menu-toggle:hover span {
    background: var(--accent);
}

/* ============================================
   Navigation Menu
   ============================================ */

/* Primary navigation - desktop layout */
nav { 
    display: flex; 
    gap: 16px; 
    align-items: center;
    flex-wrap: wrap; 
}

/* Desktop navigation styling */
@media (min-width: 769px) {
    /* 
     * DESKTOP NAVIGATION ALIGNMENT FIX:
     * 
     * Problem: Navigation items were wrapping to multiple lines on desktop,
     * causing misalignment and poor visual appearance.
     * 
     * Solution:
     * - Added flex-wrap: nowrap !important to prevent wrapping
     * - Added white-space: nowrap to prevent text wrapping within items
     * - Set flex: 0 0 auto to prevent nav from shrinking
     * - Combined with brand flex fix above, ensures proper space distribution
     */
    nav {
        width: auto;
        flex: 0 0 auto;
        display: flex !important;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        min-width: 0;
    }
}

/* Hide navigation in header on mobile - shows in slide-out menu */
@media screen and (max-width: 768px) {
    header nav {
        display: none !important;
    }
}

/* 
 * Navigation link styling with alignment fixes:
 * - white-space: nowrap prevents text wrapping within links
 * - flex-shrink: 0 prevents links from shrinking when space is tight
 */
nav a,
nav button {
  color: var(--text); 
  opacity: 0.9; 
  font-size: 14px;
  padding: 4px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s, opacity 0.2s;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

nav a:hover,
nav button:hover { 
  color: #fff; 
  opacity: 1; 
}

/* Desktop button styling */
@media (min-width: 769px) {
  nav a.btn,
  nav button.btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.0));
    min-height: auto;
  }

  nav a.btn.primary,
  nav button.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1020;
    font-weight: 700;
    border: none;
  }
}

/* ============================================
   Mobile Navigation (Slide-out Menu)
   ============================================ */

/* Navigation backdrop overlay - hidden by default */
.nav-backdrop {
    display: none;
}

@media screen and (max-width: 768px) {
    .nav-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        display: block;
    }

    .nav-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    /* 
     * MOBILE MENU FULL-WIDTH UPDATE:
     * 
     * Changed from: 280px side panel sliding from right
     * Changed to: 100% full-width overlay sliding from left
     * 
     * Changes made:
     * - width: 280px → width: 100%
     * - right: -100% → left: -100% (slides from left instead of right)
     * - transition: right → transition: left
     * - Removed border-left (no longer a side panel)
     * - Updated box-shadow positioning
     * 
     * This provides a better mobile experience with full-screen menu coverage.
     */

    /* Mobile slide-out navigation menu */
    nav {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100vh !important;
        background: linear-gradient(to bottom, #0e2721, #0b1f1a) !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 80px 24px 24px !important;
        gap: 0 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 1000 !important;
        display: none !important; /* Hidden by default */
    }

    /* Show nav when hamburger menu is active */
    nav.active {
        left: 0 !important;
        display: flex !important;
    }

    nav a,
    nav button {
        width: 100%;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
        font-size: 16px;
        min-height: auto;
        justify-content: flex-start;
        text-align: left;
        background: none;
        border-left: none;
        border-right: none;
        border-top: none;
        color: var(--text);
        opacity: 0.9;
        cursor: pointer;
    }

    nav a:hover,
    nav button:hover {
        color: #fff;
        opacity: 1;
    }

    nav a:last-child,
    nav button:last-child {
        margin-top: 12px;
        border-bottom: none;
        padding: 12px 16px;
        border: 1px solid var(--border);
        border-radius: 10px;
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    nav a.btn,
    nav button.btn {
        background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.0));
    }

    nav a.btn.primary,
    nav button.btn.primary {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        color: #0b1020;
        font-weight: 700;
        border: none;
    }
}

@media (max-width: 480px) {
    nav {
        width: 100% !important;
        left: -100% !important;
    }

    nav.active {
        left: 0 !important;
    }
}


/* ============================================
   Hero Section
   ============================================ */

/* Hero section with headline and quick facts */
.hero { 
    padding: 48px 0 24px; 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 16px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Hero fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback for browsers that don't support animations */
@supports not (animation: fadeInUp) {
    .hero,
    .hero h1,
    .hero p {
        opacity: 1 !important;
        transform: translateY(0) !important;
        animation: none !important;
    }
    
    header {
        opacity: 1 !important;
        transform: translateY(0) !important;
        animation: none !important;
    }
    
    footer {
        opacity: 1 !important;
        animation: none !important;
    }
}

/* Ensure elements are visible if animations are disabled via prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .hero,
    .hero h1,
    .hero p,
    header,
    footer {
        opacity: 1 !important;
        transform: translateY(0) !important;
        animation: none !important;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 32px 0 20px;
        gap: 20px;
    }
}

.hero h1 { 
    font-size: 40px; 
    line-height: 1.2; 
    margin: 0 0 8px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 24px;
    }
}

.hero p { 
    color: var(--muted); 
    margin: 0; 
    font-size: 16px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@media (max-width: 480px) {
    .hero p {
        font-size: 15px;
    }
}

/* Call-to-action buttons row */
.cta { 
    display: flex; 
    gap: 12px; 
    flex-wrap: wrap; 
    margin-top: 16px; 
}

@media (max-width: 480px) {
    .cta {
        flex-direction: column;
        gap: 10px;
    }
}

.btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px;
    padding: 10px 14px; 
    border-radius: 10px; 
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.0));
    color: var(--text);
    margin-right: 8px;
    font-size: 14px;
    min-height: 44px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        margin-right: 0;
        padding: 12px 16px;
        font-size: 15px;
    }
}

.btn:active {
    transform: scale(0.95) translateY(0);
}

/* Primary styled button variant */
.btn.primary { 
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
  color: #0b1020; 
  font-weight: 700; 
  border: none;
}

.btn.primary:hover {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    box-shadow: 0 6px 20px rgba(0, 166, 118, 0.4);
}


/* ============================================
   Content Sections
   ============================================ */

/* Section spacing and headings */
section { 
    padding: 24px 0; 
}

@media (max-width: 768px) {
    section {
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    section {
        padding: 16px 0;
    }
}

h2 { 
    margin: 0 0 16px; 
    font-size: 22px; 
}

@media (max-width: 480px) {
    h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }
}

/* Content card styling */
.card { 
    padding: 16px; 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.0)); 
}

@media (max-width: 480px) {
    .card {
        padding: 14px;
    }
}
 
.card h3 { 
  margin: 0 0 8px; 
  font-size: 18px; 
}

@media (max-width: 480px) {
    .card h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }
}

.card p {
    font-size: 15px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .card p {
        font-size: 14px;
    }
}
 
.card-grid { 
  display: grid; 
  gap: 16px; 
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}


/* ============================================
   Typography & Text Elements
   ============================================ */

/* Secondary/muted text styling */
.meta { 
    color: var(--muted); 
    font-size: 14px; 
}

@media (max-width: 480px) {
    .meta {
        font-size: 13px;
    }
}
 
ul.inline { 
  list-style: none; 
  padding: 0; margin: 0; 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap;
}

@media (max-width: 480px) {
    ul.inline {
        gap: 6px;
    }
}
 
ul.inline li { 
  border: 1px solid var(--border); 
  padding: 6px 10px; 
  border-radius:100px; 
  background: rgba(255,255,255,0.02); 
  font-size: 14px;
}

@media (max-width: 480px) {
    ul.inline li {
        padding: 5px 8px;
        font-size: 13px;
    }
}

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

/* Footer styling */
footer { 
    padding: 24px 0 48px; 
    color: var(--muted); 
    border-top: 1px solid var(--border); 
    margin-top: 24px; 
    font-size: 14px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s both;
}

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

@media (max-width: 480px) {
    footer {
        padding: 20px 0 32px;
        margin-top: 20px;
        font-size: 13px;
        text-align: center;
    }
}

/* ============================================
   Responsive Layout Adjustments
   ============================================ */

/* Desktop hero section - two column layout */
@media (min-width: 720px) {
    .hero { 
        grid-template-columns: 1.3fr 1fr; 
        align-items: center; 
    }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    /* Improve touch targets for mobile */
    a, button {
        -webkit-tap-highlight-color: rgba(0, 166, 118, 0.2);
    }
    
    /* Contact section button layout */
    #contact .card p {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    #contact .btn {
        width: 100%;
        margin-right: 0;
    }
    
    /* Brand name size adjustments */
    .brand > div > div:first-child {
        font-size: 18px;
    }
    
    .brand .meta {
        font-size: 12px;
    }
}

/* Background gradient adjustments for mobile */
@media (max-width: 768px) {
    body {
        background: 
            radial-gradient(80vw 40vh at 10% -10%, rgba(14,159,110,0.18), transparent 60%),
            radial-gradient(70vw 35vh at 110% 10%, rgba(0,166,118,0.14), transparent 60%),
            var(--bg);
    }
}

/* Decorative image animation */
#POB {
    animation: floatImage 4s ease-in-out infinite;
    animation-delay: 0.6s;
}

#POB img {
    transition: transform 0.3s ease;
}

#POB:hover img {
    transform: scale(1.1) rotate(5deg);
}

@keyframes floatImage {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}




