/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors - Dark Theme */
    --primary-color: #00f3ff;
    --secondary-color: #bc13fe;
    --accent-color: #0aff0a;
    --danger-color: #ff0a0a;
    --warning-color: #ffaa0a;
    --success-color: #0aff0a;
    --info-color: #00f3ff;
    
    --dark-bg: #050505;
    --darker-bg: #020202;
    --card-bg: rgba(20, 20, 20, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    
    /* Gradients */
    --gradient-1: linear-gradient(135deg, #00f3ff 0%, #bc13fe 100%);
    --gradient-2: linear-gradient(135deg, #0aff0a 0%, #00f3ff 100%);
    --gradient-3: linear-gradient(135deg, #bc13fe 0%, #ff0a0a 100%);
    --gradient-4: linear-gradient(180deg, rgba(0, 243, 255, 0.1) 0%, rgba(188, 19, 254, 0.1) 100%);
    --gradient-5: linear-gradient(90deg, #00f3ff, #bc13fe, #0aff0a);
    
    /* Typography */
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    
    /* Spacing */
    --section-padding: 80px;
    --container-max: 1400px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-base: 0 5px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 243, 255, 0.3);
    --shadow-glow-lg: 0 0 60px rgba(0, 243, 255, 0.4);
    
    /* Border Radius */
    --radius-sm: 5px;
    --radius-base: 10px;
    --radius-lg: 20px;
    --radius-full: 50%;
    
    /* Z-index layers */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal: 1500;
    --z-tooltip: 2000;
    --z-max: 9999;
}

/* Light Theme Variables */
.light-theme {
    --dark-bg: #f5f5f5;
    --darker-bg: #e8e8e8;
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(0, 243, 255, 0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-base: 0 5px 20px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-base), color var(--transition-base);
}

body.loaded {
    opacity: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.1rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
    outline: none;
}

a:hover,
a:focus {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-base);
}

button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition-base);
    outline: none;
}

button:focus {
    outline: none;
}

ul, ol {
    list-style: none;
}

input,
textarea,
select {
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-base);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-left: 1px solid rgba(0, 243, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 5px;
    transition: var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-2);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: var(--dark-bg);
}

::-moz-selection {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* Canvas Backgrounds */
#matrixCanvas,
#networkCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#matrixCanvas {
    opacity: 0.15;
}

#networkCanvas {
    opacity: 0.4;
}

/* Cursor Effect */
.cursor {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: var(--z-max);
    mix-blend-mode: difference;
    transition: transform 0.1s;
    display: none;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: calc(var(--z-max) - 1);
    transition: transform 0.3s ease-out;
    display: none;
}

@media (min-width: 1024px) {
    .cursor,
    .cursor-follower {
        display: block;
    }
}

.cursor.hover {
    transform: scale(2);
    background: var(--secondary-color);
}

.cursor-follower.hover {
    transform: scale(1.5);
    border-color: var(--secondary-color);
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-1);
    z-index: calc(var(--z-fixed) + 1);
    transition: width 0.1s;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Utility Classes */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
    z-index: var(--z-base);
}

.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.text-gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.text-gradient-2 {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-1);
    animation: glow-line 2s infinite;
}

.glow {
    animation: glow-effect 2s ease-in-out infinite;
}

.glow-secondary {
    animation: glow-effect-secondary 2s ease-in-out infinite;
}

/* Glass Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }
    
    .cursor,
    .cursor-follower {
        display: none;
    }
}

/* Print Styles */
@media print {
    .preloader,
    .navbar,
    .cursor,
    .cursor-follower,
    #matrixCanvas,
    #networkCanvas,
    .scroll-progress,
    .back-to-top {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        padding: 20px 0;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to Content */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--dark-bg);
    padding: 8px 16px;
    z-index: var(--z-max);
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}
/* ==================== FIX GREEN BOX OVERFLOW ==================== */

/* Prevent any overflow */
body, html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Hide any elements that might cause overflow */
.certificates-grid,
.certificate-card,
.projects-grid,
.project-card {
    overflow: hidden;
    position: relative;
}

/* Fix certificate cards */
.certificate-card {
    position: relative;
    overflow: hidden;
}

.cert-badge {
    position: relative;
    z-index: 1;
}

/* Fix for mobile - hide decorative elements */
@media (max-width: 768px) {
    .cert-badge::before,
    .cert-badge::after,
    .skill-card::before,
    .skill-card::after,
    .project-card::before,
    .project-card::after {
        display: none;
    }
    
    /* Hide any pseudo elements that might cause overflow */
    *::before,
    *::after {
        max-width: 100%;
    }
}

/* Fix scroll behavior */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Ensure all sections respect viewport */
section {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Fix container overflow */
.container {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Hide any debug elements */
.debug,
.debug-box,
.test-element {
    display: none !important;
}

/* Fix for certificate section specifically */
.certificates {
    overflow: hidden;
}

.certificates-grid {
    position: relative;
    overflow: hidden;
}

/* Prevent elements from going off screen */
@media (max-width: 480px) {
    .certificate-card,
    .project-card,
    .skill-card {
        transform: none !important;
    }
    
    .certificate-card:hover,
    .project-card:hover,
    .skill-card:hover {
        transform: none !important;
    }
}

/* Fix back to top button positioning */
.back-to-top {
    z-index: 999;
    position: fixed;
}

/* Ensure no element exceeds viewport */
* {
    max-width: 100%;
}

/* Fix for any absolutely positioned elements */
[class*="floating"],
[class*="absolute"] {
    max-width: 100vw;
}
/* ==================== FINAL FIX - HIDE GREEN BOX ==================== */

/* Hide any elements causing overflow on mobile */
@media (max-width: 768px) {
    /* Hide decorative elements completely */
    .floating-shapes,
    .grid-overlay,
    .profile-ring,
    .profile-badges,
    .floating-tech-icons,
    .profile-stats-floating,
    .profile-corner,
    .experience-card,
    .about-img-frame {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Fix stat items overflow */
    .hero-stats {
        overflow: hidden;
        position: relative;
    }
    
    .stat-item {
        overflow: hidden;
        position: relative;
    }
    
    /* Fix any pseudo elements */
    .stat-item::before,
    .stat-item::after,
    .hero::before,
    .hero::after {
        display: none !important;
    }
}

/* Prevent any fixed/absolute elements from overflowing */
body {
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Ensure sections don't overflow */
section {
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}

/* Fix for hero section specifically */
.hero {
    overflow: hidden;
    position: relative;
}

.hero-bg-effects {
    overflow: hidden;
}

/* Hide any debug or test elements */
.debug,
.test-element,
.debug-box {
    display: none !important;
}

/* Fix certificate and project cards on mobile */
@media (max-width: 480px) {
    .certificates-grid,
    .projects-grid,
    .skills-grid {
        overflow: hidden;
    }
    
    .certificate-card,
    .project-card,
    .skill-card {
        overflow: hidden;
        transform: none !important;
    }
    
    .certificate-card:hover,
    .project-card:hover,
    .skill-card:hover {
        transform: none !important;
    }
}

/* Ensure footer doesn't cause overflow */
.footer {
    overflow: hidden;
    position: relative;
}

/* Fix back to top button */
.back-to-top {
    z-index: 999;
}

/* Hide any elements with negative positioning that might cause overflow */
[class*="shape"],
[class*="floating"] {
    max-width: 100vw;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    /* Hide all decorative shapes */
    .shape-1,
    .shape-2,
    .shape-3,
    .shape-4,
    .shape-5 {
        display: none !important;
    }
    
    /* Fix profile wrapper */
    .profile-wrapper {
        overflow: visible;
    }
    
    /* Ensure no element exceeds viewport */
    * {
        max-width: 100%;
    }
}
/* ==================== FINAL FIX - MOBILE OVERFLOW ==================== */

/* Hide decorative elements on mobile */
@media (max-width: 768px) {
    .floating-shapes,
    .grid-overlay,
    .profile-ring,
    .profile-badges,
    .floating-tech-icons,
    .profile-stats-floating,
    .profile-corner,
    .experience-card,
    .about-img-frame,
    .scroll-indicator {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Fix hero stats overflow */
    .hero-stats {
        overflow: hidden !important;
        position: relative !important;
    }
    
    .stat-item {
        overflow: hidden !important;
        position: relative !important;
    }
    
    /* Remove any pseudo elements */
    .hero::before,
    .hero::after,
    .stat-item::before,
    .stat-item::after,
    .hero-stats::before,
    .hero-stats::after {
        display: none !important;
    }
    
    /* Fix profile wrapper */
    .profile-wrapper {
        overflow: visible !important;
    }
    
    /* Fix about section */
    .about-images {
        overflow: hidden !important;
    }
    
    .about-img-wrapper {
        overflow: hidden !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .profile-wrapper {
        width: 200px !important;
        height: 260px !important;
    }
    
    .profile-image-container {
        width: 180px !important;
        height: 230px !important;
    }
    
    .hero-stats {
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    
    .stat-item {
        width: 100% !important;
    }
}

/* Prevent any horizontal scroll */
body, html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* Ensure all sections respect viewport */
section {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Fix container */
.container {
    max-width: 100% !important;
    overflow-x: hidden !important;
}
/* Hide toast by default */
.toast {
    display: none !important;
}

/* Show only when needed */
.toast.show {
    display: flex !important;
}
