/* Section Subtitle Animation Styles */

/* Section Subtitle animation */
.section-subtitle {
    font-size: 1.8rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    font-family: var(--font-secondary);
    opacity: 0;
    transform: translateY(20px);
    animation: subtitleFadeIn 1s forwards 0.5s;
}

/* Light mode section subtitle */
body.light-mode .section-subtitle {
    color: #1976D2; /* Secondary blue color */
}

.section-subtitle.with-animation::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    animation: expandLine 2s ease-out forwards 1s;
}

/* Light mode subtitle underline */
body.light-mode .section-subtitle.with-animation::after {
    background: linear-gradient(to right, transparent, #1976D2, transparent);
}

@keyframes subtitleFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes expandLine {
    from { width: 0; }
    to { width: 100px; }
}

/* Title Animation */
.section-title-styled, .skills-heading {
    animation: titlePulse 3s infinite alternate;
}

@keyframes titlePulse {
    0% { transform: scale(1); text-shadow: 0 0 5px rgba(255, 215, 0, 0.3), 0 2px 5px rgba(0, 0, 0, 0.7); }
    100% { transform: scale(1.05); text-shadow: 0 0 15px rgba(255, 215, 0, 0.7), 0 2px 5px rgba(0, 0, 0, 0.7); }
}

/* Light mode animations */
body.light-mode .section-title-styled,
body.light-mode .skills-heading {
    animation: titlePulseLight 3s infinite alternate;
    color: #0D47A1;
}

/* Make section titles stand out against any background */
.section-title-styled, .skills-heading {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

@keyframes titlePulseLight {
    0% { transform: scale(1); text-shadow: 0 0 5px rgba(30, 136, 229, 0.3), 0 2px 5px rgba(0, 0, 0, 0.2); }
    100% { transform: scale(1.05); text-shadow: 0 0 15px rgba(30, 136, 229, 0.7), 0 2px 5px rgba(0, 0, 0, 0.2); }
}

/* Section Title Color Animation */
.section-title-styled, .skills-heading {
    background: linear-gradient(90deg, var(--gold), var(--light-purple), var(--gold));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent !important;
    text-shadow: none !important;
    animation: gradientText 6s linear infinite;
}

@keyframes gradientText {
    to {
        background-position: 200% center;
    }
}

body.light-mode .section-title-styled,
body.light-mode .skills-heading {
    background: linear-gradient(90deg, #1976D2, #0D47A1, #1976D2);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    animation: gradientText 6s linear infinite;
}

/* Final light mode overrides to ensure all animations use blue colors */
body.light-mode .section-subtitle-label {
    color: #1976D2 !important; 
}

body.light-mode .section-subtitle {
    color: #1976D2 !important;
}

body.light-mode .section-subtitle.with-animation::after {
    background: linear-gradient(to right, transparent, #1976D2, transparent) !important;
}

/* Technical skills title light mode */
body.light-mode .technical-title {
    color: #1976D2 !important;
}

/* Skills and Tools subtitle special styling */
.tools-subtitle {
    margin-top: 3rem;
}

/* Enhanced section title animations */

/* Remove square decorations and replace with better animations */
.section-title-styled {
    position: relative;
    display: inline-block;
    padding: 0 15px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-title-styled::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: 0;
    left: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease-out;
    animation: slideInLine 1s forwards 0.5s;
}

@keyframes slideInLine {
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

.section-title-styled::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    bottom: -3px;
    right: 0;
    transform: translateX(0);
    animation: slideCircle 1s forwards 1.5s;
}

@keyframes slideCircle {
    to {
        transform: translateX(-100%);
    }
}

body.light-mode .section-title-styled::before,
body.light-mode .section-title-styled::after {
    background: #1976D2;
}

/* Text animation for section title */
.section-title-styled span {
    display: inline-block;
    animation: fadeInRandom 1.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* More visible underscore for subtitle */
.section-subtitle.with-animation {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-subtitle.with-animation::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--gold);
    transform: translateX(-50%);
    animation: expandWidth 1.5s forwards 0.5s;
    box-shadow: 0 0 10px var(--gold);
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 120px; }
}

body.light-mode .section-subtitle.with-animation::after {
    background: #1976D2;
    box-shadow: 0 0 10px #1976D2;
}

/* Gradient color animation for titles */
.section-title-styled {
    background: linear-gradient(90deg, var(--gold), var(--light-purple), var(--gold));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientText 6s linear infinite;
}

@keyframes gradientText {
    to {
        background-position: 200% center;
    }
}

body.light-mode .section-title-styled {
    background: linear-gradient(90deg, #1976D2, #0D47A1, #1976D2);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
}

/* Add character split animation */
.section-title-styled.animated-text {
    display: inline-block;
}

.section-title-styled.animated-text span {
    animation-delay: calc(var(--char-index) * 0.05s);
}

/* Text reveal animation */
.section-subtitle {
    position: relative;
    overflow: hidden;
}

.section-subtitle span {
    display: inline-block;
    transform: translateY(100%);
    animation: revealText 0.8s forwards;
    animation-delay: calc(var(--char-index) * 0.03s + 0.5s);
}

@keyframes revealText {
    to {
        transform: translateY(0);
    }
}