/***********   IMPORTS   *****************/

@import "tailwindcss";

@theme {
  --color-primary-pale: rgba(229, 234, 221, 1.00);
  --color-primary-pale2: #EADDFF;
  --color-primary-middle: rgba(164, 185, 155, 1.00);
  --color-primary-more: rgb(105, 131, 94);
  --color-primary-dark: rgba(28, 34, 29, 1.00);
  --color-secondary-pale: rgba(183, 183, 198, 1.00);
}

/***********   CSS VARIABLES   *****************/

:root {
    --jld-dark-green-50: rgba(28, 34, 29, 0.50);
    --jld-light-gray: #eeeeee;

    --default-font-size: 18px;
    --default-line-height: 1.25;
    --default-font-weight: 300;
    --jld-h1-font-size: calc(var(--default-font-size) * 4);
    --jld-h1-font-size-mob: calc(var(--default-font-size) * 2.8);
    --jld-h2-font-size: calc(var(--default-font-size) * 3);
    --jld-h2-font-size-mob: calc(var(--default-font-size) * 1.8);
    --jld-h3-font-size: calc(var(--default-font-size) * 1.4);
    --jld-h4-font-size: calc(var(--default-font-size) * 1.2);

    --default-padding: 30px;

    --default-link-color: var(--color-primary-pale);
    --default-link-color-hover: var(--color-primary-pale);
    --default-link-color-dark: var(--color-primary-dark);
    --default-transition-time: 400ms;

    --swiper-theme-color: var(--color-primary-dark);
}

/***********   LAYOUT STABILITY   *****************/

/* Prevent animations during page load */
.preload * {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}

/***********   TYPOGRAPHY   *****************/

/* Fix for viewport width including scrollbars */
html {
    overflow-x: hidden;
    background-color: var(--color-primary-dark);
}

body {
    font-family: 'Inconsolata', sans-serif;
    text-transform: none;
    font-size: var(--default-font-size);
    line-height: var(--default-line-height);
    font-weight: var(--default-font-weight);
}

h1, h2, h3, h4 {
    font-family: 'MisoBold', sans-serif;
    font-weight: var(--default-font-weight);
}

h1 {
    font-size: var(--jld-h1-font-size);
    text-transform: uppercase;
}

h2 {
    font-size: var(--jld-h2-font-size);
}

h2#project-modal-title {
    font-size: calc(var(--jld-h2-font-size) * 0.6);
    line-height: 1.1;
}

h3 {
    font-size: var(--jld-h3-font-size);
}

h4 {
    font-size: var(--jld-h4-font-size);
}

@media only screen and (max-device-width: 639px) {
    h1 {
        font-size: var(--jld-h1-font-size-mob);
    }
    h2 {
        font-size: var(--jld-h2-font-size-mob);
    }
}

/***********   COLORS & LINKS   *****************/

a {
    color: var(--default-link-color);
    -webkit-transition: all var(--default-transition-time) cubic-bezier(0.175, 0.885, 0.32, 1.075);
    transition: all var(--default-transition-time) cubic-bezier(0.175, 0.885, 0.32, 1.075);
}

a:hover {
    color: var(--default-link-color-hover);
}

/* Custom JLD Colors - Only Used Ones */
.jld-bg-middle-green {
    background-color: var(--color-primary-middle);
}

.jld-color-dark-green {
    color: var(--color-primary-dark);
}

/***********   HEADER & NAVIGATION   *****************/

#header_wrapper {
    position: absolute;
    z-index: 100;
    top: 0; 
    left: 0; 
    right: 0;
    padding-top: calc(var(--default-padding) * 0.5);
    padding-bottom: calc(var(--default-padding) * 0.5);
}

.header-logo.logo-image {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100px;
    height: 50px;
}

.header-logo.logo-image img {
    position: relative;
    display: block;
    z-index: 10;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.standard-menu-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.standard-menu-container ul.menu > li {
    position: relative;
    display: inline-block;
    line-height: 38px;
    margin: 0 0 0 var(--default-padding);
}

.standard-menu-container ul.menu > li > a {
    color: var(--default-link-color-dark);
    text-decoration: none;
    font-family: 'MisoBold', sans-serif;
    font-weight: var(--default-font-weight);
}

#sticky_header .standard-menu-container ul.menu > li > a {
    @apply text-primary-pale;
    text-decoration: none;
}

#sticky_header .standard-menu-container ul.menu > li > a.active {
    position: relative;
}

#sticky_header .standard-menu-container ul.menu > li > a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary-pale);
    animation: underlineSlide var(--default-transition-time) ease-out forwards;
}
@media only screen and (max-device-width: 639px) {
    #sticky_header .standard-menu-container ul.menu > li > a:not(.active)::after {
        display: none !important;
    }
}

@keyframes underlineSlide {
    from {
        width: 0;
        left: 0;
        right: 100%;
    }
    to {
        width: 100%;
        left: 0;
        right: 0;
    }
}

#sticky_menu_principal {
    display: flex;
    justify-content: right;
}

.standard-menu-container ul#sticky_menu_principal.menu > li {
    margin: 0 30px 0 0;
}

@media only screen and (max-device-width: 639px) {
    .standard-menu-container ul.menu > li {
        line-height: 1.2;
        margin: 0 0 0 0;
    }

    #sticky_menu_principal {
        justify-content: space-between;
    }

    .standard-menu-container ul#sticky_menu_principal.menu > li {
        font-size: 14px;
        margin: 0 2px;
    }
}


/***********   UTILITY CLASSES   *****************/

/* Responsive Images */
.responsive-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Lazy Loading */
.lazy-img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

.lazy-img.loaded {
    opacity: 1;
    background: none;
    animation: none;
}

.lazy-img.error {
    opacity: 1;
    background: #f5f5f5;
    animation: none;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .lazy-img {
        animation: none;
        transition: none;
    }
}

/* Tailwind 3D Extensions */
.preserve-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

/***********   SERVICE SECTION   *****************/

.perfect-for {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%, 0);
}

.text-with-bar::before {
    @apply bg-primary-dark;
    content: '';
    position: absolute;
    bottom: 13px;
    left: -30px;
    height: 1px;
    width: 30px;
}

.text-with-bar::after {
    @apply bg-primary-dark;
    content: '';
    position: absolute;
    bottom: 13px;
    right: -30px;
    height: 1px;
    width: 30px;
}

/***********   ECO SECTION (GREEN TABS)   *****************/

.green-tab-btn {
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.green-tab-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.green-tab-btn:hover {
    color: #374151;
}

.green-tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.green-tab-content.active {
    display: block;
    opacity: 1;
}

/***********   ANIMATIONS   *****************/

/* AOS Custom Animation */
[data-aos="small-slide-up"] {
    transform: translate3d(0, 50px, 0);
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos="small-slide-up"].aos-animate {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

/* Swiper Customization */
.swiper-button-next,
.swiper-button-prev {
    display: none !important;
}
.swiper-pagination-bullet-active {
    background: var(--color-primary-dark) !important;
}

/***********   CARBON TRACKING BADGE   *****************/

.carbon-badge-display {
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    border: 1px solid;
}

.carbon-badge-aplus {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #047857;
}

.carbon-badge-a {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #059669;
}

.carbon-badge-b {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb;
}

.carbon-badge-c {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #d97706;
}

.carbon-badge-d {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #dc2626;
}

.carbon-rating-line {
    font-weight: bold;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.carbon-grade {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.carbon-details {
    opacity: 0.9;
    font-size: 0.65rem;
    margin-bottom: 2px;
}

.carbon-hosting {
    opacity: 0.85;
    font-size: 0.6rem;
}

.carbon-badge-error {
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    padding: 10px;
}

.carbon-error-icon {
    margin-bottom: 4px;
}

.carbon-error-text {
    font-size: 0.65rem;
    opacity: 0.7;
}

/***********   COOKIE CONSENT BANNER   *****************/

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(28, 34, 29, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 2rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 2px solid var(--color-primary-middle);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-primary-pale);
}

.cookie-banner p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    opacity: 0.9;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: var(--color-primary-middle);
    color: var(--color-primary-dark);
}

.cookie-btn-accept:hover {
    background: var(--color-primary-more);
    color: white;
}

.cookie-btn-decline {
    background: transparent;
    color: var(--color-primary-pale);
    border: 1px solid var(--color-primary-middle);
}

.cookie-btn-decline:hover {
    background: var(--color-primary-middle);
    color: var(--color-primary-dark);
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        max-width: 120px;
    }
}
