/* =========================================
   bioERGOtech Foundation — Shared Styles
   ========================================= */

/* --- CSS Variables --- */
:root {
    --primary: #13d6b0;
    --primary-dark: #0eb093;
    --primary-light: #61ffe0;
    --dark: #333;
    --darker: #1a1a1a;
    --light: #fff;
    --light-gray: #f5f5f5;
    --medium-gray: #9e9e9e;
}

/* --- Base --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Utility --- */
.bg-light {
    background-color: var(--light);
}

.bg-light-gray {
    background-color: var(--light-gray);
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary) 0%, #64ffda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight {
    position: relative;
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10%;
    background-color: var(--primary);
    opacity: .3;
    z-index: -1;
    transition: height .3s ease;
}

.highlight:hover::after {
    height: 50%;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all .3s ease;
    display: inline-block;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(19, 214, 176, .2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, .2);
    transition: all .5s ease;
    z-index: -1;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(19, 214, 176, .3);
}

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

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--dark);
    padding: 11px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all .3s ease;
    display: inline-block;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: transparent;
    z-index: 1;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--primary);
    transition: all .5s ease;
    z-index: -1;
}

.btn-outline:hover {
    color: #fff;
}

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

/* --- Sections --- */
.section {
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
}

.section-title {
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    transition: width .5s ease;
}

.section-title:hover::after {
    width: 100%;
}

/* --- Cards --- */
.card {
    background-color: rgba(255, 255, 255, .8);
    border-radius: 16px;
    padding: 30px;
    margin: 15px 0;
    transition: all .5s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), transparent);
    opacity: 0;
    transition: all .5s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .1);
    background-color: #fff;
}

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

.problem-card,
.approach-card,
.strategy-card,
.hub-card,
.market-card {
    transition: all .5s cubic-bezier(.175, .885, .32, 1.275);
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, .05);
}

.problem-card:hover,
.approach-card:hover,
.strategy-card:hover,
.hub-card:hover,
.market-card:hover {
    transform: translateY(-10px);
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .1);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: rgba(19, 214, 176, .1);
    border-radius: 50%;
    transition: all .5s ease;
    margin-bottom: 20px;
}

.card-icon i {
    font-size: 1.8rem;
    color: var(--primary);
    transition: all .5s ease;
}

.problem-card:hover .card-icon,
.approach-card:hover .card-icon,
.strategy-card:hover .card-icon,
.hub-card:hover .card-icon,
.market-card:hover .card-icon {
    background-color: var(--primary);
    transform: scale(1.1) rotate(5deg);
}

.problem-card:hover .card-icon i,
.approach-card:hover .card-icon i,
.strategy-card:hover .card-icon i,
.hub-card:hover .card-icon i,
.market-card:hover .card-icon i {
    color: #fff;
}

/* --- Animated Background --- */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.animated-bg .circle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary);
    opacity: .05;
    filter: blur(60px);
    animation: pulse 15s infinite alternate;
}

.animated-bg .circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.animated-bg .circle:nth-child(2) {
    width: 500px;
    height: 500px;
    top: 60%;
    right: -10%;
    animation-delay: 5s;
}

.animated-bg .circle:nth-child(3) {
    width: 400px;
    height: 400px;
    bottom: 10%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: .05; }
    50%  { transform: scale(1.4); opacity: .08; }
    100% { transform: scale(1);   opacity: .05; }
}

/* --- Navbar --- */
.navbar {
    background-color: rgba(255, 255, 255, .95);
    backdrop-filter: blur(15px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all .4s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, .98);
    padding: .5rem 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .05);
}

.nav-link {
    position: relative;
    color: var(--dark);
    transition: all .3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width .3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

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

.nav-link.active {
    color: var(--primary);
}

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

/* --- Logo --- */
.logo-text {
    font-weight: 700;
    font-size: 1.6rem;
    background: linear-gradient(90deg, var(--primary) 0%, var(--dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
    transition: all .3s ease;
}

.logo-text:hover {
    transform: scale(1.05);
}

.ergo-text {
    color: var(--dark);
    font-weight: 700;
    -webkit-text-fill-color: var(--dark);
    transition: all .3s ease;
}

.logo-text:hover .ergo-text {
    -webkit-text-fill-color: var(--primary-light);
}

/* --- Mobile Menu --- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100%;
    background-color: rgba(255, 255, 255, .98);
    backdrop-filter: blur(10px);
    z-index: 1100;
    transition: all .5s cubic-bezier(.77, 0, .175, 1);
    padding: 80px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: -5px 0 30px rgba(0, 0, 0, .05);
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav-link {
    font-size: 1.5rem;
    margin: 15px 0;
    display: block;
    color: var(--dark);
    text-decoration: none;
    transition: all .3s ease;
    opacity: 0;
    transform: translateX(50px);
}

.mobile-menu.active .mobile-nav-link {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active .mobile-nav-link:nth-child(1) { transition-delay: .1s; }
.mobile-menu.active .mobile-nav-link:nth-child(2) { transition-delay: .2s; }
.mobile-menu.active .mobile-nav-link:nth-child(3) { transition-delay: .3s; }
.mobile-menu.active .mobile-nav-link:nth-child(4) { transition-delay: .4s; }
.mobile-menu.active .mobile-nav-link:nth-child(5) { transition-delay: .5s; }
.mobile-menu.active .mobile-nav-link:nth-child(6) { transition-delay: .6s; }
.mobile-menu.active .mobile-nav-link:nth-child(7) { transition-delay: .7s; }

.mobile-nav-link:hover {
    color: var(--primary);
    padding-left: 10px;
}

.menu-toggle {
    position: relative;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1200;
}

.menu-toggle span {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--dark);
    transition: all .3s ease;
    left: 0;
    border-radius: 3px;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle span:nth-child(3) { bottom: 0; }

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 10px;
    background-color: var(--primary);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-30px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 12px;
    background-color: var(--primary);
}

/* --- Progress Bar --- */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1001;
}

.progress-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0;
    box-shadow: 0 0 10px var(--primary);
}

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transition: all .3s ease;
    transform: translateY(20px);
    box-shadow: 0 5px 15px rgba(19, 214, 176, .3);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(19, 214, 176, .5);
}

/* --- Images --- */
.featured-image {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
    transition: all .5s ease;
    max-width: 100%;
    height: auto;
}

.featured-image:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(19, 214, 176, .2);
}

.image-container {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
    position: relative;
}

.image-container img {
    transition: transform .5s ease;
    width: 100%;
    height: auto;
}

.image-container:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(19, 214, 176, .7));
    opacity: 0;
    transition: opacity .5s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    box-sizing: border-box;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay-text {
    color: #fff;
    font-weight: 600;
    transform: translateY(20px);
    transition: transform .5s ease;
}

.image-container:hover .image-overlay-text {
    transform: translateY(0);
}

/* --- Arrow Icon --- */
.arrow-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    background-color: var(--primary);
    clip-path: polygon(0 30%, 70% 30%, 70% 0, 100% 50%, 70% 100%, 70% 70%, 0 70%);
    transition: all .3s ease;
    animation: arrow-pulse 1.5s infinite;
}

@keyframes arrow-pulse {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* --- Forms --- */
.form-input {
    width: 100%;
    padding: 14px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 8px;
    color: var(--dark);
    transition: all .3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .03);
    outline: none;
}

.form-input:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(19, 214, 176, .2);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    transition: all .3s ease;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    color: var(--primary);
}

/* --- Gradient Border --- */
.gradient-border {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.gradient-border::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), transparent, var(--primary));
    z-index: -1;
    border-radius: 18px;
    animation: rotate-gradient 10s linear infinite;
}

@keyframes rotate-gradient {
    0%   { background-position: 0 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* --- Responsive --- */
@media screen and (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }
}
