/* Global Styles */
html {
    --primary-color: #6a0dad;
    --secondary-color: #f7b733;
    --text-color: #333;
    --background-color: #f4f4f4;
    --light-gray: #e6e6fa;
    --header-height: 70px;
}

html {
    scroll-padding-top: var(--header-height); /* Nodrošina, ka saturs nepaslēpjas zem galvenes, lecot uz enkuriem */
    scroll-behavior: smooth; /* Pievieno plūdenu ritināšanu */
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background-color);
    color: var(--text-color);
}

h1, h2, h3 {
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: none;
    color: var(--primary-color);
}

/* Header and Navigation - fixed height, compact, no shifting */
header {
    background-color: var(--primary-color);
    color: white;
    height: 56px; /* Fixed height for all views */
    min-height: 56px;
    max-height: 56px;
    padding: 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
}

nav {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

nav ul li {
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

nav ul li:hover {
    background-color: #520a83; /* Darker shade of primary color */
}

nav a {
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
    display: block; /* Ensure the link fills the li */
}

nav a:hover {
    color: white; /* Keep text color white */
    text-decoration: none; /* Remove underline on hover */
}

.hamburger-btn {
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 1200;
}

/* Language Switcher Styles - match nav items */
.lang-switch {
    position: absolute;
    top: 50%;
    right: 60px;
    transform: translateY(-50%);
    z-index: 1100;
    background: none;
    border-radius: 5px;
    min-width: 60px;
    text-align: right;
    font-family: inherit;
}

.lang-current {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    background: none;
    border: none;
    font-size: 1rem;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.lang-current:hover, .lang-current:focus {
    background-color: #520a83;
    color: white;
    outline: 2px solid #00bcd4;
}

.lang-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--primary-color);
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    min-width: 60px;
    margin-top: 2px;
}

.lang-switch.open .lang-dropdown {
    display: block;
}

.lang-option {
    color: white;
    text-decoration: none;
    display: block;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 5px;
    background: none;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.5;
}

.lang-option:hover {
    background-color: #520a83;
    color: white;
}

/* Sections */
section {
    padding: 40px 20px;
    margin: 0 auto;
    max-width: 1200px;
}

.hero {
    background-color: var(--light-gray);
    text-align: center;
    padding: 80px 20px;
}

.hero-content > * {
    opacity: 0;
}

.hero-content > *.animate {
    animation: fadeIn 1s ease-out forwards;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.2em;
}

.hero-content h1.animate { animation-delay: 0.2s; }
.hero-content h2.animate { animation-delay: 0.6s; }
.hero-content p.animate { animation-delay: 1s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.about-content img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

.hero-subtitle {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em; /* Pielāgojam fonta izmēru */
}

.about-intro {
    font-size: 1.1em;
    line-height: 1.6;
}

.about-content h3 {
    color: #333;
    margin-top: 20px;
}

.about-content ul {
    list-style-type: none;
    padding-left: 0;
}

.about-content ul li {
    margin-bottom: 10px;
    background-color: var(--light-gray);
    padding: 8px;
    border-radius: 5px;
}

/* Noņem apakšējo atstarpi pēdējam saraksta elementam */
.about-content ul li:last-child {
    margin-bottom: 0;
}

.about-passion {
    font-style: italic;
}

.about-cta {
    text-align: center;
    margin-top: 30px;
    font-weight: bold;
    color: var(--primary-color);
}

.project-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.project-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.project-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

.project-card h3 {
    margin-top: 0;
}

.project-card button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.project-card button:hover {
    background-color: #520a83; /* Darker shade of primary color, matches modal */
}
.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Atstarpe starp etiķeti un ievades lauku */
    margin-bottom: 15px; /* Atstarpe starp lauku grupām */
}

.modal-body label {
    font-weight: bold;
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.modal-body input[type="text"]:focus,
.modal-body input[type="email"]:focus,
.modal-body textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
    outline: none;
}

.modal-body button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.modal-body button[type="submit"]:hover {
    background-color: #520a83; /* Darker shade of primary color */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex; /* Show when active */
}

.modal-content {
    background-color: #fefefe;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.5s ease-out;
    overflow: hidden; /* To keep border-radius on children */
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
}

.modal-header h2 {
    color: inherit;
    margin: 0;
    font-size: 1.5em;
}

.modal-body {
    padding: 20px 30px 30px 30px;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 12px;
    right: 15px;
    transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: #ccc;
    text-decoration: none;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.social-links a {
    color: white;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

/* Responsive Design for Navigation */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        width: auto;
        background-color: var(--primary-color);
        padding: 0.5rem 0;
        box-sizing: border-box;
        gap: 5px;
        margin: 0;
    }
    nav ul.active {
        display: flex;
    }
    nav ul li {
        padding: 10px 20px;
        width: 100%;
        box-sizing: border-box;
    }
    .hamburger-btn {
        display: block;
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: white;
        font-size: 1.4rem;
        cursor: pointer;
        z-index: 1200;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    /* Place the dropdown immediately to the right of the hamburger */
    /* Force absolute positioning and placement next to hamburger */
    #nav-links {
        position: absolute !important;
        left: 56px !important; /* hamburger width + spacing */
    top: 8px !important; /* align near top of header/hamburger */
    transform: none !important; /* remove centering transform so top is exact */
    background: rgba(106,13,173,0.88) !important; /* slightly translucent purple */
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    backdrop-filter: blur(6px) saturate(120%);
    border-radius: 6px;
    border-left: 1px solid rgba(0,0,0,0.12) !important; /* subtle separator */
    box-shadow: -6px 0 12px rgba(0,0,0,0.08) inset, 0 6px 20px rgba(0,0,0,0.08); /* inner left shadow + drop shadow */
        padding: 6px 0 !important; /* remove horizontal padding to make content flush */
        display: none !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
        z-index: 1100 !important;
    overflow: hidden !important;
    max-height: calc(100vh - 20px) !important; /* keep menu within viewport */
    overflow-y: auto !important; /* allow scrolling if there are many items */
        min-width: 140px !important; /* ensure visible area for 4 items */
        max-width: calc(100% - 64px) !important;
        align-items: flex-start !important; /* ensure items are left-aligned inside box */
    }
    #nav-links.active {
        display: flex !important;
        flex-direction: column !important;
    }
    #nav-links li {
        padding: 0; /* remove extra padding to be flush with container */
        width: 100%;
        box-sizing: border-box;
        text-align: left; /* left-align list content */
        margin: 0; /* ensure no outer gap */
    }
    /* Make anchors block-level and left-aligned to appear like paragraph items */
    #nav-links a {
        display: block !important;
        width: 100% !important;
        padding: 8px 12px 8px 12px !important; /* internal horizontal padding only */
        font-size: 1rem !important;
        white-space: normal !important; /* allow wrapping if needed */
        text-align: left !important;
        color: white !important;
        box-sizing: border-box !important;
        margin: 0; /* no external gap */
    }
    /* subtle hover/focus to improve contrast over underlying content */
    #nav-links a:hover,
    #nav-links a:focus {
        background: rgba(82,10,131,0.95) !important; /* darker on hover */
        outline: none !important;
    }
}

/* Ensure hamburger and lang-switch are always vertically centered in header */
.hamburger-btn, .lang-switch {
    top: 50%;
    transform: translateY(-50%);
}
