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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #000;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #00f3ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4e6;
}

/* Navigation Styles */
nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Section Spacing with subtle rays */
section {
    position: relative;
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(0, 243, 255, 0.02) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(0, 212, 230, 0.015) 0%, transparent 35%),
        linear-gradient(45deg, transparent 60%, rgba(0, 243, 255, 0.008) 80%, transparent 100%);
    animation: sectionRays 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

section > * {
    position: relative;
    z-index: 1;
}

@keyframes sectionRays {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-5px) translateY(-3px);
    }
    50% {
        opacity: 0.6;
        transform: translateX(5px) translateY(3px);
    }
}

/* Card Styles with animated rays */
.card {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(0, 243, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 212, 230, 0.03) 0%, transparent 40%),
        linear-gradient(45deg, transparent 70%, rgba(0, 243, 255, 0.02) 90%, transparent 100%);
    animation: cardRays 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card:hover {
    border-color: rgba(0, 243, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    transform: translateY(-2px);
}

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

@keyframes cardRays {
    0%, 100% {
        transform: translateX(-3px) translateY(-2px) rotate(0deg);
    }
    50% {
        transform: translateX(3px) translateY(2px) rotate(1deg);
    }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(90deg, #000 0%, #003 100%);
    color: #00f3ff;
    border: 1px solid #00f3ff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    box-shadow: 0 0 15px #00f3ff;
    text-shadow: 0 0 5px #00f3ff;
    transform: translateY(-1px);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f3ff, #0099cc);
    border-radius: 3px;
    transition: width 1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Skill Badge */
.skill-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 243, 255, 0.1);
    color: #00f3ff;
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.25rem;
}

/* Project Card */
.project-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.project-card:hover {
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.15);
    transform: translateY(-3px);
}

/* Contact Info */
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.4);
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 243, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00f3ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }

    .project-card {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }
}

/* CV Section Responsive Improvements */
@media (max-width: 1024px) {
    #cv-content .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (max-width: 640px) {
    #cv-content .max-w-6xl {
        padding: 0 1rem;
    }

    #cv-content .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    #cv-content .card {
        padding: 0.75rem !important;
    }

    #cv-content h2 {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }

    #cv-content .space-y-4 > * + * {
        margin-top: 0.75rem !important;
    }

    #cv-content .text-xs {
        font-size: 0.75rem !important;
    }

    #cv-content .border-l-2 {
        padding-left: 0.5rem !important;
    }

    #cv-content .project-card {
        padding: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    #cv-content .max-w-6xl {
        padding: 0 0.5rem;
    }

    #cv-content .grid {
        gap: 0.5rem !important;
    }

    #cv-content .card {
        padding: 0.5rem !important;
    }

    #cv-content h2 {
        font-size: 0.8rem !important;
    }

    #cv-content .text-xs {
        font-size: 0.7rem !important;
    }

    #cv-content .project-card {
        padding: 0.375rem !important;
    }

    #cv-content .space-y-3 > * + * {
        margin-top: 0.5rem !important;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 243, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00f3ff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger Animation */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }

/* Utility Classes */
.text-glow {
    text-shadow: 0 0 10px currentColor;
}

.border-glow {
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.bg-glass {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Grid Background */
.grid-bg {
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Pulse Animation */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
    }
}

/* Animated Ray Background for entire website */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 243, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 212, 230, 0.025) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(0, 255, 200, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 30%, rgba(0, 200, 255, 0.025) 0%, transparent 40%),
        linear-gradient(45deg, transparent 30%, rgba(0, 243, 255, 0.01) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(0, 212, 230, 0.01) 50%, transparent 70%),
        linear-gradient(135deg, transparent 40%, rgba(0, 255, 200, 0.008) 60%, transparent 80%);
    animation: rayAnimation 25s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 70% 60%, rgba(0, 243, 255, 0.02) 0%, transparent 60%),
        radial-gradient(circle at 30% 40%, rgba(0, 212, 230, 0.015) 0%, transparent 50%),
        linear-gradient(90deg, transparent 20%, rgba(0, 243, 255, 0.005) 50%, transparent 80%),
        linear-gradient(180deg, transparent 30%, rgba(0, 255, 200, 0.008) 70%, transparent 100%);
    animation: rayAnimation2 30s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: -1;
}

@keyframes rayAnimation {
    0%, 100% {
        opacity: 0.4;
        transform: translateX(-20px) translateY(-15px) rotate(0deg) scale(1);
    }
    25% {
        opacity: 0.7;
        transform: translateX(15px) translateY(10px) rotate(1deg) scale(1.05);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-10px) translateY(20px) rotate(-1deg) scale(0.95);
    }
    75% {
        opacity: 0.8;
        transform: translateX(25px) translateY(-10px) rotate(0.5deg) scale(1.02);
    }
}

@keyframes rayAnimation2 {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(10px) translateY(20px) rotate(0deg) scale(1);
    }
    33% {
        opacity: 0.6;
        transform: translateX(-15px) translateY(-5px) rotate(-0.5deg) scale(1.03);
    }
    66% {
        opacity: 0.4;
        transform: translateX(20px) translateY(15px) rotate(1deg) scale(0.98);
    }
}
