/* Import Google Font */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100;200;300;400;700&display=swap");
    
:root {
    --primary: #4ba38d; /* blue-600 */
    --primary-hover: #3f8b78; /* blue-700 */
}

* {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #333333;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Page transition animations */
#landing, #main-layout {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

#landing {
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#landing.hidden, #main-layout.hidden {
    display: none;
}

.line-height-1 {
    line-height: 1;
}

@media (min-width: 768px) {
    #main-layout {
        max-width: 750px;
        margin: 0 auto;
    }
}

/* Flag selected state */
#languages img[selected],
#lang-en-landing img[selected],
#lang-sv-landing img[selected] {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    opacity: 1 !important;
}

/* Tab visibility */
[tab] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

[tab]:not([active]) {
    display: none;
}

[tab][active] {
    opacity: 1;
}

/* Link hover behavior */
.link-group:hover a {
    text-decoration: none;
}

a:hover {
    text-decoration: dotted;
}

a:active {
    text-decoration: underline;
}

/* Language visibility control */
body[lang="en"] [lang="sv"] {
    display: none;
}

body[lang="sv"] [lang="en"] {
    display: none;
}

/* Custom utility classes */
.service-list {
    margin-left: 1.5em;
    margin-top: 8px;
}

/* Syntax highlighting for scrolling code */
#code-scroll {
    opacity: 0.5;
}

#code-scroll pre,
#code-scroll code {
    background: transparent !important;
}

.tagline {
    font-size: 20px;
    font-weight: 300;
    margin-bottom: 12px;
    color: #202020;
}

/* Devicons baseline alignment fix */
[class*="devicon-"] {
    line-height: 1 !important;
}

/* Lucide icon styling - stroke-based with proper colors */
[data-lucide] {
    fill: none;
    stroke-width: 2;
}

/* Landing page icons - primary color stroke */
#landing [data-lucide] {
    stroke: var(--primary);
}

/* Header icons - darker gray stroke */
#contact-links [data-lucide] {
    stroke: #4a5568; /* gray-700 */
    transition: stroke 0.2s ease;
}

#contact-links a:hover [data-lucide] {
    stroke: #1a202c; /* gray-900 */
}


/* Rotating text animation */
#rotating-word {
    margin: 0;
    padding: 0;
    line-height: 1;
    vertical-align: bottom;
    height: 1em;
    margin-right: 6px;
}

.comma {
    margin-right: 6px;
}

.word-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: right;
    display: block;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    line-height: 1;
}

.subheader {
    transform: translateX(-20px);
}

.subheader-line-1,
.subheader-line-2,
.subheader-line-3 {
    display: inline;
}

.subheader-line-1 {
    line-height: 1;
}

.subheader-line-2 {
    margin-right: 0.25em;
}

/* Mobile Navigation */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.burger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1003;
}

.burger-btn span {
    width: 25px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
}

.burger-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 75%;
    max-width: 300px;
    background-color: #ffffff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1002;
    overflow-y: auto;
}

.burger-menu.active {
    transform: translateX(0);
}

.burger-menu-content {
    padding: 80px 20px 20px;
    display: flex;
    flex-direction: column;
}

.burger-menu-item {
    margin: 16px 0;
    font-size: 18px;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.burger-menu-item:hover {
    color: var(--primary);
}

.burger-menu-divider {
    height: 1px;
    background-color: #e5e5e5;
    margin: 20px 0;
}

.burger-menu-languages {
    display: flex;
    gap: 12px;
    padding: 20px 0;
}

.burger-lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.burger-lang-btn:hover {
    opacity: 1;
}

.burger-lang-btn img {
    width: 32px;
    height: auto;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        background-color: #ffffff;
    }

    .mobile-header {
        display: flex;
    }

    #desktop-header {
        display: none !important;
    }

    #main-nav {
        display: none !important;
    }

    #contact-links {
        display: none !important;
    }

    #main-layout {
        padding-top: 60px;
    }

    #tab-container {
        width: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* Ensure contact form matches Services page width */
    [tab="contact"] {
        width: 100% !important;
    }

    #contact-form,
    #contact-form * {
        box-sizing: border-box !important;
    }

    /* Landing page subheader - split into 3 lines */
    .subheader {
        flex-direction: column !important;
        align-items: center !important;
        transform: none !important;
    }

    .subheader-line-1,
    .subheader-line-2,
    .subheader-line-3 {
        display: block;
    }

    /* Hide comma on mobile */
    .subheader-line-1 span[lang="en"]:not(#rotating-word):not(#rotating-word *),
    .subheader-line-1 span[lang="sv"]:not(#rotating-word):not(#rotating-word *) {
        display: none;
    }

    #rotating-word {
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        text-align: center !important;
        vertical-align: middle;
    }

    #rotating-word .word-item {
        text-align: center !important;
        vertical-align: middle;
    }

    /* Landing page spacing and sizing */
    #landing h1 {
        padding-bottom: 1rem;
        font-size: 3rem; /* Smaller than desktop's text-6xl */
    }

    /* Reduce subheader size on mobile */
    #landing .subheader {
        font-size: 1.25rem; /* Smaller than desktop's text-2xl (1.5rem) */
    }

    .subheader-line-1 {
        line-height: inherit;
        text-align: center;
    }

    /* Bigger flags on mobile */
    #languages img {
        width: 36px !important;
        height: auto !important;
    }

    .burger-lang-btn img {
        width: 36px !important;
        height: auto !important;
    }
}

/* Extra small screens - button spacing and landing page padding */
@media (max-width: 450px) {
    #landing .text-center.w-full.px-12.bg-white {
        padding-left: 10% !important;
        padding-right: 10% !important;
    }

    #landing-buttons a {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    #landing h1 {
        font-size: 2.5rem !important;
    }
}

/* Very small screens only - button space-between */
@media (max-width: 399px) {
    #landing-buttons {
        justify-content: space-between !important;
    }
}

/* Spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}