* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #f3f0fb 0%, #e0d7f8 100%);
    color: #333;
    padding-bottom: 72px;
    max-width: 100%;
}

/* Header */
.header {
    background: #292561;
    color: white;
    box-shadow: 0 8px 32px rgba(94, 42, 132, 0.3);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

:root {
    --header-height: 72px;
}

.header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
   
}

.header h1 {
    font-size: 1.5rem;
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    margin-top: 0.5rem;
    font-weight: 100;
}

.header .subtitle {
    font-size: 1rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

@media (max-width: 768px) {
    .header {
        padding: 1rem 1rem;
    }

    .header h1 {
        font-size: 1rem; /* mazāks uz telefoniem */
    }

    .header p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 0.5rem; /* ļoti maziem ekrāniem */
    }

    .header p {
        font-size: 0.9rem;
    }
}

/* Container */

.container {
    max-width: 800px;
    min-height: calc(100vh - 15rem);
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 1rem;
}



.quiz-container {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(109, 40, 217, 0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(109, 40, 217, 0.1);
}

/* Questions */
.question {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.question.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.question h2 {
    color: #292561;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.question p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #292561;
}

/* Options */
.options {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.option {
    background: linear-gradient(135deg,#faf5ff 0%,#f3e8ff 100%);
    border: 2px solid #e9d5ff;
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    text-align: center;
    font-weight: 500;
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg,transparent,rgba(109,40,217,0.1),transparent);
    transition: left 0.6s;
}

.option:hover::before {
    left: 100%;
}

.option:hover {
    border-color: #292561;
    background: linear-gradient(135deg,#EDE0F9 0%,#F2E6FC 100%);
    box-shadow: 0 10px 25px rgba(94,42,132,0.25);
    transform: translateY(-3px);
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,#5E2A84,#7B3AAE);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Result */
.result {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.result.active {
    display: block;
}

.result h2 {
    color: #292561;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.profession-card {
    background: linear-gradient(135deg,#292561, #5E2A84);
    box-shadow: 0 15px 40px rgba(94,42,132,0.3);
    color: white;
    padding: 2.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
}

.profession-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(30px,-30px);
}

.profession-card h3 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.profession-card p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Restart button */
.restart-btn {
    background: linear-gradient(135deg,#292561, #7B3AAE);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1.5rem 0 1rem 0;
    box-shadow: 0 4px 15px rgba(94,42,132,0.3);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(109,40,217,0.4);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: #292561;
    font-weight: 500;
}

.footer a {
    color: #292561;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

.small-gap {
  margin-top: 6.5px; /* regulē atstarpi starp rindām */
}
.url {
    font-size: 0.9rem;
    color: white;
}


/* Jā/Nē opcijas blakus */
.options {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Wrapper, lai Sākt vienmēr ir centrā */
.start-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

/* Sākt poga – konfekšu virtenes stilā */
.option-start {
    background: repeating-linear-gradient(
        135deg,
        #292561, /* tumšāks variants no #7c3aed */
        #292561 20px,
        #4b1f7a, /* tumšāks variants no #8b5cf6 */
        #4b1f7a 40px
    );
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    border: 2px solid #4b1f7a;
    border-radius: 15px; 
    padding: 0.8rem 3rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(108, 46, 207, 0.3); /* nedaudz tumšāks ēnojums */
    min-width: 200px;
    width: 50%;
}


/* Gaismas efekts */
.option-start::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s;
}

/* Hover animācija */
.option-start:hover::before {
    left: 100%;
}

.option-start:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(124,58,237,0.5);
}

/* Jā/Nē pogas stilizācija */

.option-yes {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #34d399;
    color: #065f46;
    flex: 1;
    text-align: center;
}

.option-yes:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #059669;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.option-no {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #f87171;
    color: #991b1b;
    flex: 1;
    text-align: center;
}

.option-no:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.back-button {
    display: none; /* sākumā slēpta */
    margin: 1rem 0 1rem 0; /* centrs horizontāli, neliels augšējais margiņš */
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #292561;
    background-color: rgba(124, 58, 237, 0.1);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.back-button:hover {
    background-color: rgba(124, 58, 237, 0.2);
}

.credit-bar {
    background: #292561;
    color: white;
    text-align: center;
    padding: 0 1rem; /* horizontal padding, height controlled below */
    font-size: 0.95rem;
    position: fixed;      /* keep at bottom on all devices */
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;         /* visible stripe height — adjust if needed */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;        /* on top of other content */
    box-shadow: 0 -6px 18px rgba(0,0,0,0.08);
}

.credit-bar a {
    color: white;
    text-decoration: underline;
    font-weight: 200;
}
.credit-bar a:hover {
    color: #d1d5db; /* gaišāks pelēks uz hover */
}


/* Atbilžu koka vizualizācija */
.tree-visualization pre {
    display: none;
    white-space: pre-wrap;   /* saglabā atstarpes, bet lauž rindas */
    word-wrap: break-word;   /* papildus pārlauž garus vārdus */
    overflow-x: auto;        /* ja kaut kas vēl pārsniedz, parādīt scroll */
    max-width: 100%;         /* nepārsniedz konteineru platumu */
    background: #f8f8f8;     /* opcija: fons lai labāk izceltu tekstu */
    padding: 1rem;
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}


.tree-visualization h3 {
    display: none;
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #292561;
    font-weight: 600;
}

/* Koka struktūra */
.tree {
    display: flex;
    justify-content: center;
}

.tree ul {
    position: relative;
    padding-top: 20px;
    transition: all 0.5s;
    list-style-type: none;
}

.tree li {
    display: inline-block;
    vertical-align: top;
    text-align: center;
    position: relative;
    padding: 20px 5px 0 5px;
}

/* Savienojošās līnijas */
.tree li::before, .tree li::after {
    content: '';
    position: absolute;
    top: 0;
    border-color: #292561;
    border-top: 2px solid #7c3aed;
    width: 50%;
    height: 20px;
}

.tree li::before {
    left: -50%;
    border-right: 2px solid #7c3aed;
}

.tree li::after {
    right: -50%;
    border-left: 2px solid #7c3aed;
}

.tree li:only-child::before, 
.tree li:only-child::after {
    display: none;
}

.tree li:only-child { padding-top: 0; }

.tree li:first-child::before,
.tree li:last-child::after {
    border: none;
}

/* Kastiņas (jaut./atb.) */
.tree li div {
    border: 2px solid #292561;
    padding: 10px 20px;
    border-radius: 12px;
    background: white;
    display: inline-block;
    font-size: 0.95rem;
    min-width: 120px;
}

/* Responsive */
@media(max-width:768px){
    .header h1 { font-size: 2rem; }
    .quiz-container { padding: 1.5rem; }
    .container { margin: 2rem auto; }
    .question.active {
        padding: 0.5rem;
        margin: 0.5rem auto;
    }
}
@media (max-width: 480px) {
    .question h2 {
        font-size: 1.2rem;
    }
    .question p {
        font-size: 1rem;
    }
    .options .option {
        padding: 1rem;
        font-size: 0.95rem;
    }
}
.credit-bar span.separator {
    display: inline; /* noklusējums desktopam */
}

@media (max-width: 600px) {
    .credit-bar span.separator {
        display: block; /* uz maziem ekrāniem uz jaunas rindas */
        margin-top: 0.3rem; /* neliela atstarpe */
    }
}

