/* Custom CSS for Rochelle's Portfolio */

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevent any element from causing horizontal scroll */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix for wide elements */
.container, section, div {
    max-width: 100%;
    box-sizing: border-box;
}

/* Mobile specific resets - only for body/html */
@media (max-width: 768px) {
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
}

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

::-webkit-scrollbar-track {
    background: #0F0F0F;
}

::-webkit-scrollbar-thumb {
    background: #8B5CF6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5B21B6;
}

/* Navigation Styles */
.nav-link {
    position: relative;
    color: #D1D5DB;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #8B5CF6;
}

.nav-link.active {
    color: #8B5CF6;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8B5CF6, #EF4444);
    transition: width 0.3s ease;
}

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

.mobile-nav-link {
    color: #D1D5DB;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: #8B5CF6;
    background-color: rgba(139, 92, 246, 0.1);
}

/* Typing Animation */
.typing-cursor {
    animation: blink 1s infinite;
    color: #8B5CF6;
    font-weight: normal;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Button Animations */
.cta-button {
    position: relative;
    overflow: hidden;
}

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

.cta-button:hover::before {
    left: 100%;
}

.outline-button {
    position: relative;
    overflow: hidden;
}

.outline-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #8B5CF6;
    transition: width 0.3s ease;
    z-index: -1;
}

.outline-button:hover::before {
    width: 100%;
}

/* Fun Facts Cards */
.fun-fact-card {
    transition: all 0.3s ease;
}

.fun-fact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

/* Portfolio Items */
.portfolio-item {
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

/* Gallery Items */
.gallery-item {
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

.gallery-filter-btn {
    position: relative;
    overflow: hidden;
}

.gallery-filter-btn.active {
    background: linear-gradient(135deg, #8B5CF6, #5B21B6);
    color: white;
}

.gallery-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #8B5CF6, #5B21B6);
    transition: width 0.3s ease;
    z-index: -1;
}

.gallery-filter-btn:hover::before {
    width: 100%;
}

.gallery-filter-btn:hover {
    color: white;
}

.portfolio-btn {
    position: relative;
    overflow: hidden;
}

.portfolio-btn::before {
    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 0.5s;
}

.portfolio-btn:hover::before {
    left: 100%;
}

/* Portfolio Filter Buttons */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn.active {
    background: linear-gradient(135deg, #8B5CF6, #5B21B6);
    color: white;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #8B5CF6, #5B21B6);
    transition: width 0.3s ease;
    z-index: -1;
}

.filter-btn:hover::before {
    width: 100%;
}

.filter-btn:hover {
    color: white;
}

/* Timeline Animations */
.experience-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.experience-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.experience-item:nth-child(even) {
    transform: translateX(30px);
}

.experience-item:nth-child(even).animate {
    transform: translateX(0);
}

/* FAQ Animations */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.1);
}

.faq-question:hover h3 {
    color: #8B5CF6;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.active {
    max-height: 200px;
}

/* Social Links */
.social-link {
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* Form Styles */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Modal Animations */
#portfolio-modal {
    transition: all 0.3s ease;
}

#portfolio-modal.show {
    display: flex !important;
}

.modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

#portfolio-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animate-pulse-subtle {
    animation: pulse 2s infinite;
}

/* Loading Animation */
.loading-spinner {
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top: 2px solid #8B5CF6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #8B5CF6, #EF4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Elements */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.2s infinite;
    color: #8B5CF6;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.2s infinite;
    color: #EF4444;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    60% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(-2px, 2px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Container fixes */
    .container, .max-w-7xl, .max-w-6xl, .max-w-5xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Navigation fixes */
    .nav-link::after {
        display: none;
    }
    
    /* Hero section mobile fixes */
    #home {
        padding: 1rem 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh !important;
    }
    
    #home .max-w-7xl {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 1rem !important;
    }
    
    #home .grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        gap: 2rem !important;
    }
    
    .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .hero-content > div:first-child {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
        padding: 0 !important;
    }
    
    .hero-content h1 {
        font-size: 2rem !important; /* 32px */
        line-height: 1.2 !important;
        margin: 0 0 1rem 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
        word-wrap: break-word !important;
    }
    
    .hero-content p {
        font-size: 1rem !important; /* 16px */
        line-height: 1.5 !important;
        margin: 0 0 1.5rem 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Timeline fixes */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-item::before {
        left: 15px;
    }
    
    /* Experience cards mobile - restore normal styling */
    .experience-card h3 {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.3;
    }
    
    .experience-card h4 {
        font-size: 1rem !important; /* 16px */
        line-height: 1.3;
    }
    
    .experience-card p {
        font-size: 0.875rem !important; /* 14px */
        line-height: 1.4;
    }
    
    /* Background elements mobile */
    .bg-blur-element {
        display: none; /* Hide decorative elements on mobile */
    }
    
    /* Restore normal section spacing */
    section {
        padding: 4rem 0 !important;
    }
    
    .max-w-7xl, .max-w-6xl, .max-w-5xl {
        margin: 0 auto !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {    
    body, html {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    /* Hero section for very small screens */
    #home {
        width: 100% !important;
        margin: 0 !important;
        padding: 1rem 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh !important;
    }
    
    #home .max-w-7xl {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 0.5rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.75rem !important; /* 28px */
        line-height: 1.2 !important;
        margin: 0 0 1rem 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-content p {
        font-size: 0.9rem !important; /* 14.4px */
        line-height: 1.4 !important;
        margin: 0 0 1.5rem 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-content .welcome-text {
        font-size: 0.8rem !important; /* 12.8px */
        text-align: center !important;
        display: block !important;
        width: 100% !important;
        margin: 0 0 0.75rem 0 !important;
        padding: 0 !important;
    }
    
    /* Restore normal padding for other sections */
    section:not(#home) {
        padding: 3rem 0 !important;
    }
    
    .max-w-7xl, .max-w-6xl, .max-w-5xl {
        margin: 0 auto !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Override experience timeline for mobile */
    #experience .relative.flex.items-center {
        display: block !important;
        margin-bottom: 2rem;
    }
    
    #experience .flex-1 {
        flex: none !important;
        width: 100% !important;
        padding: 0 !important;
        text-align: left !important;
    }
    
    #experience .absolute {
        display: none !important;
    }
    
    /* Mobile experience card improvements */
    #experience .bg-dark-card {
        padding: 1rem !important;
        margin: 0.5rem 0 !important;
    }
    
    #experience .bg-dark-card h3 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    #experience .bg-dark-card h4 {
        font-size: 0.875rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.25rem !important;
    }
    
    #experience .bg-dark-card p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
    }
    
    #experience .bg-dark-card img {
        width: 2.5rem !important;
        height: 2.5rem !important;
        margin-right: 0.75rem !important;
    }
}

/* Print Styles */
@media print {
    .fixed,
    .sticky {
        position: static !important;
    }
    
    .bg-dark-bg,
    .bg-dark-card {
        background: white !important;
        color: black !important;
    }
    
    .text-white {
        color: black !important;
    }
    
    .border-dark-border {
        border-color: #ccc !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .text-gray-400 {
        color: #ffffff !important;
    }
    
    .border-dark-border {
        border-color: #ffffff !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-smooth {
        scroll-behavior: auto;
    }
}

/* Focus Styles for Accessibility */
.focus\:ring-2:focus {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #8B5CF6;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    transition: top 0.3s;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}
