/* ===================================
   ROBOTICS CLUB - REUSABLE COMPONENTS
   Buttons, Cards, Forms, and UI Elements
   =================================== */

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--action-blue), var(--success-cyan));
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(50, 130, 184, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--success-cyan);
    color: var(--success-cyan);
}

.btn-outline:hover {
    background: var(--success-cyan);
    color: var(--primary-bg);
}

.btn-secondary {
    background: var(--accent-blue);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--action-blue);
}

/* ===================================
   CARDS
   =================================== */
.card {
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid var(--success-cyan);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.4), inset 0 0 20px rgba(0, 217, 255, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

/* Moving Light Effect for .card (Permanent) */
.card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3000px;
    height: 3000px;
    background: conic-gradient(transparent 240deg,
            var(--success-cyan) 300deg,
            transparent 360deg);
    transform: translate(-50%, -50%);
    animation: border-flow 4s linear infinite;
    z-index: -2;
    opacity: 1;
}

/* Inner Background */
.card::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--secondary-bg);
    border-radius: 11px;
    z-index: -1;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-glow);
    border-color: transparent;
}

/* ===================================
   CARD 2 (Permanent Moving Light)
   =================================== */
.card2 {
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid transparent !important;
    /* No default border needed as light covers it, but keeps sizing */
    background: var(--secondary-bg);
    /* Fallback */
    border-radius: inherit;
    /* Attempt to inherit */
}

/* Ensure card2 has border-radius if not inherited or set on element */
.card2:not([style*="border-radius"]) {
    border-radius: 12px;
}

.card2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3000px;
    /* Larger size for zero glitch */
    height: 3000px;
    background: conic-gradient(transparent 240deg,
            var(--success-cyan) 300deg,
            transparent 360deg);
    transform: translate(-50%, -50%);
    animation: border-flow 4s linear infinite;
    z-index: -2;
    opacity: 1;
    /* Always visible */
}

.card2::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--secondary-bg);
    border-radius: inherit;
    /* Match parent radius */
    z-index: -1;
}

/* Fix for specific border-radius on pseudo-elements if needed */
.filter-btn.card2::after {
    border-radius: 23px;
    /* 25px - 2px approx */
}


/* ===================================
   CARD PILL (For Pill-shaped Buttons)
   =================================== */
.card-pill {
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid transparent !important;
    background: var(--secondary-bg);
    border-radius: 50px !important;
    /* Force pill shape */
}

.card-pill::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: conic-gradient(transparent 240deg,
            var(--success-cyan) 300deg,
            transparent 360deg);
    transform: translate(-50%, -50%);
    animation: border-flow 4s linear infinite;
    z-index: -2;
    opacity: 1;
}

.card-pill::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--secondary-bg);
    border-radius: 50px;
    z-index: -1;
}



.card-pill.active,
.card-pill:hover {
    color: var(--success-cyan) !important;
}

/* ===================================
   CARD PROFILE (For Circular Profile Images)
   =================================== */
.card-profile {
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-radius: 50%;
    /* Circular */
    padding: 2px;
    /* Reduced by ~30% from 3px */
    display: inline-block;
}

.card-profile::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: conic-gradient(transparent 240deg,
            var(--success-cyan) 300deg,
            transparent 360deg);
    transform: translate(-50%, -50%);
    animation: border-flow 4s linear infinite;
    z-index: -2;
    opacity: 1;
}

.card-profile::after {
    content: '';
    position: absolute;
    inset: 2px;
    /* Match padding */
    background: var(--secondary-bg);
    border-radius: 50%;
    z-index: -1;
}

.card-profile img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 0;
}

@keyframes border-flow {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-white);
}

.card-text {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--accent-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===================================
   GRID LAYOUTS
   =================================== */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: transparent;
    overflow: hidden;
}

.flying-robot {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    width: 250px;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(0, 217, 255, 0.5));
    animation: floatRobot 6s ease-in-out infinite;
}

.robot-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.robot-container img {
    width: 100%;
    height: auto;
    mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 70%);
    mask-image: radial-gradient(circle, black 30%, transparent 70%);
}

.robot-legs {
    position: absolute;
    top: 70%;
    width: 40%;
    display: flex;
    justify-content: space-around;
    z-index: -1;
}

.leg {
    width: 15px;
    height: 50px;
    background: #000;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.3);
    animation: legDangle 3s ease-in-out infinite;
}

.leg-left {
    animation-delay: 0s;
}

.leg-right {
    animation-delay: -1.5s;
}

@keyframes legDangle {

    0%,
    100% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

.robot-left {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.robot-right {
    top: 20%;
    right: 12%;
    animation-delay: -3s;
    /* Removed transform: scaleX(-1) to keep design identical as requested */
}

@keyframes floatRobot {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

#heroCanvas {
    position: fixed;
    /* Fixed background */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    z-index: -1;
    /* Behind everything */
    background: radial-gradient(circle at center, #1a1a2e 0%, #0f1c2e 100%);
    /* Deep dark blue gradient */
}

.hero::before {
    /* Optional: Keep dark overlay if needed, or remove if canvas is opaque */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    /* Let canvas show */
    pointer-events: none;
}

.background-octopus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.9;
    filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.2));
    animation: octopusFloat 8s ease-in-out infinite, octopusGlow 4s ease-in-out infinite;
}

.background-octopus svg {
    width: 100%;
    height: 100%;
}

.tentacle-img {
    transform-origin: 100px 100px;
    animation: tentacleSway 6s ease-in-out infinite;
}

.octopus-eye-ring {
    animation: eyePulse 3s ease-in-out infinite;
}

@keyframes eyePulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes tentacleSway {

    0%,
    100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }
}

.tentacle-img:nth-child(even) {
    animation-delay: -1.5s;
}

@keyframes octopusGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.1));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(0, 217, 255, 0.3));
    }
}

@keyframes headGlow {

    0%,
    100% {
        fill: #000;
    }

    50% {
        fill: #001a2e;
    }
}

@keyframes tentacleGlow {

    0%,
    100% {
        stroke: #000;
        filter: drop-shadow(0 0 2px rgba(0, 217, 255, 0.2));
    }

    50% {
        stroke: #001a2e;
        /* Very dark blue center */
        filter: drop-shadow(0 0 8px rgba(0, 217, 255, 0.5));
    }
}

@keyframes octopusFloat {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-30px);
    }
}

@keyframes tentacleWave {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(3deg) scale(1.05);
    }
}

.hero-title-group {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 180px));
    /* Position above octopus */
    text-align: center;
    z-index: 4;
    width: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center everything including logo */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-logo {
    position: absolute;
    top: 2rem;
    left: 2rem;
    width: 120px;
    height: auto;
    filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 20px rgba(0, 217, 255, 0.8));
    z-index: 3;
    animation: pulseLogoGlow 3s infinite ease-in-out;
}

@keyframes pulseLogoGlow {

    0%,
    100% {
        filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 15px rgba(0, 217, 255, 0.6));
        transform: scale(1);
    }

    50% {
        filter: brightness(1.4) contrast(1.2) drop-shadow(0 0 30px rgba(0, 217, 255, 0.9));
        transform: scale(1.05);
    }
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fadeInUp 1s ease, pulseHeadingGlow 4s ease-in-out infinite 1s;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--success-cyan);
    margin: 0;
    font-family: 'Inter', sans-serif;
    animation: fadeInUp 1s ease 0.2s backwards, pulseHeadingGlow 4s ease-in-out infinite 1.2s;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s backwards;
}

/* ===================================
   FORMS
   =================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-white);
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--secondary-bg);
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--success-cyan);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===================================
   BADGES & TAGS
   =================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 20px;
    background: var(--accent-blue);
    color: var(--text-white);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-cyan {
    background: var(--success-cyan);
    color: var(--primary-bg);
}

/* ===================================
   STATS COUNTER
   =================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--secondary-bg);
    border-radius: 12px;
    border: 2px solid var(--accent-blue);
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--success-cyan);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--success-cyan);
    font-family: 'Orbitron', sans-serif;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-gray);
    margin-top: 0.5rem;
}

/* ===================================
   TIMELINE
   =================================== */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-blue);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    width: 45%;
    padding: 1.5rem;
    background: var(--secondary-bg);
    border-radius: 12px;
    border: 2px solid var(--accent-blue);
}

.timeline-year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-cyan);
    color: var(--primary-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

/* ===================================
   FILTER BUTTONS
   =================================== */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.625rem 1.5rem;
    background: var(--secondary-bg);
    border: 2px solid var(--accent-blue);
    border-radius: 25px;
    color: var(--text-white);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--success-cyan);
    border-color: var(--success-cyan);
    color: var(--primary-bg);
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

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

/* ===================================
   LOADING SPINNER
   =================================== */
.spinner {
    border: 3px solid var(--accent-blue);
    border-top: 3px solid var(--success-cyan);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}