/* ============================================================
   TAMHUND ATFERDSCOACH (THAC) - STYLE SHEET V4.7 FINAL
   ============================================================ */

/* --- 1. CONTAINER & BAKGRUNN --- */
.thac-wrapper {
    position: relative;
    padding: 3rem;
    border-radius: 12px;
    overflow: hidden;
    color: #333;
    max-width: 800px;
    margin: 30px auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    background-color: #fff;
}

.thac-parallax {
    background-image: url('https://tamhund.no/wp-content/uploads/2025/01/Bjeffing-hos-puddel.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.thac-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92); /* Hvit overlay for lesbarhet */
    backdrop-filter: blur(5px);
    z-index: 0;
}

.thac-content {
    position: relative;
    z-index: 2;
}

/* --- 2. TYPOGRAFI --- */
.thac-main-title {
    text-align: center;
    font-size: 2.8rem;
    color: #2c3e50;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: none;
    line-height: 1.2;
}

.thac-subtitle {
    text-align: center;
    font-size: 1.4rem;
    color: #555;
    margin-bottom: 20px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.thac-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 20px;
    display: block;
}

.thac-start-screen {
    text-align: center;
    padding: 20px;
}

.thac-start-screen h2 {
    color: #27ae60;
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.thac-start-screen p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #444;
}

/* --- 3. PROGRESS BAR & FELTER --- */
.thac-progress-wrapper {
    margin-bottom: 2rem;
}

#thac-progress-text {
    text-align: center;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 5px;
}

.thac-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

#thac-progress-fill {
    width: 0%;
    height: 100%;
    background: #27ae60;
    transition: width 0.4s ease;
}

.thac-field {
    margin-bottom: 20px;
}

.thac-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.thac-field input[type="text"],
.thac-field input[type="number"],
.thac-field input[type="email"],
.thac-field select {
    width: 100%;
    padding: 0 15px;
    height: 54px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
}

/* Custom pil for select-bokser */
.thac-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.thac-field input:focus,
.thac-field select:focus {
    border-color: #27ae60;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

/* --- VALIDERING (RØD RAMME & TEKST) --- */
.thac-input-error {
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.thac-error-msg {
    color: #e74c3c;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 8px;
    font-weight: 700;
    display: block;
}

.thac-premium-field {
    background-color: #fff !important; 
    /* Feltene er nå åpne, så vi bruker standard hvit bakgrunn */
}

/* --- CHECKBOX STYLING (STOR BOKS) --- */
.thac-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thac-checkbox-label {
    display: flex !important;
    align-items: center !important;
    background: #fff;
    border: 2px solid #e0e0e0;
    padding: 15px !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    height: auto !important;
    width: 100%;
    box-sizing: border-box;
}

.thac-checkbox-label:hover {
    border-color: #27ae60;
    background: #e9f7ef;
}

.thac-checkbox-label input[type="checkbox"] {
    width: 24px !important;
    height: 24px !important;
    margin-right: 15px !important;
    transform: scale(1.2);
    accent-color: #27ae60;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #ccc;
}

/* --- 4. KNAPPER --- */
.thac-button {
    background-color: #27ae60;
    color: #fff !important;
    border: none;
    padding: 0 40px !important;
    height: 54px !important;
    border-radius: 50px;
    font-size: 1.7rem !important;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 140px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.thac-button:hover {
    background-color: #219150;
    transform: translateY(-2px);
    color: #fff !important;
}

.thac-grey {
    background-color: #bdc3c7;
    color: #555 !important;
}

.thac-grey:hover {
    background-color: #95a5a6;
    color: #fff !important;
}

.thac-center-start {
    display: flex;
    justify-content: center;
    width: 100%;
}

.thac-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* --- 5. RESULTAT VISNING (WEB) --- */

/* Arketype Boks */
.thac-archetype-box {
    background: #fff;
    padding: 0;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.thac-arch-header {
    background: #2c3e50;
    color: #fff;
    padding: 10px;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: bold;
}

.thac-arch-title {
    text-align: center;
    color: #27ae60;
    font-size: 2rem;
    margin: 20px 0 10px;
    font-weight: 800;
}

.thac-arch-desc {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    padding: 0 20px;
    margin-bottom: 30px;
    font-style: italic;
}

.thac-score-grid {
    display: flex;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.thac-stat {
    flex: 1;
    text-align: center;
    padding: 15px;
    border-right: 1px solid #eee;
}

.thac-stat:last-child {
    border-right: none;
}

.thac-stat span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
}

.thac-stat strong {
    font-size: 1.4rem;
    color: #333;
}

.thac-analysis-text {
    padding: 25px;
    background: #fff;
    line-height: 1.6;
}

.thac-analysis-text h3 {
    margin-top: 0;
    color: #e67e22;
    font-size: 1.2rem;
}

/* Graf */
.thac-graph-container {
    padding: 20px;
    background: #fff8e1;
    border-top: 1px dashed #e67e22;
    text-align: center;
}

.thac-graph-visual {
    position: relative;
    height: 150px;
    background: #fff;
    border-left: 2px solid #333;
    border-bottom: 2px solid #333;
    margin: 20px auto;
    width: 90%;
}

.thac-line-free {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 20%;
    height: 80%;
    border-top: 3px solid #e74c3c;
    border-right: 3px solid #e74c3c;
    background: linear-gradient(to top, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.3));
    border-radius: 0 5px 0 0;
}

.thac-line-free:after {
    content: '❌';
    position: absolute;
    right: -10px;
    top: -15px;
    font-size: 12px;
}

.thac-line-premium {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-top: 3px solid #27ae60;
    background: none;
    border-radius: 0 100px 0 0;
    opacity: 0.5;
    border-style: dashed;
}

.thac-graph-caption {
    font-size: 0.85rem;
    color: #d35400;
    font-weight: bold;
    margin-top: 5px;
}

.thac-axis-y {
    position: absolute;
    top: -20px;
    left: -30px;
    font-size: 10px;
    font-weight: bold;
}

.thac-axis-x {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 10px;
    font-weight: bold;
}

/* SOS Box (Pulserende) */
.thac-sos-box {
    background: #fee;
    border: 2px solid #e74c3c;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    animation: pulseSOS 2s infinite;
}

.thac-sos-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.thac-sos-content h3 {
    margin: 0 0 5px;
    color: #c0392b;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.thac-sos-content p {
    margin: 0;
    color: #333;
    font-weight: bold;
}

@keyframes pulseSOS {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* --- 6. UKEVISNING & LÅSING --- */
.thac-week-container {
    margin-bottom: 30px;
    position: relative;
}

.thac-week-title {
    background: #2c3e50;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
    margin: 0;
    font-size: 1.2rem;
}

.thac-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.thac-day-card {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
}

.thac-day-header {
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
}

/* Låst uke styles */
.thac-week-locked .thac-days-grid {
    display: block;
    position: relative;
    padding-bottom: 0;
    min-height: 250px;
    overflow: hidden;
}

.thac-day-faded {
    opacity: 0.5;
    filter: blur(2px);
    pointer-events: none;
    margin-top: 15px;
    user-select: none;
}

.thac-premium-blur-overlay {
    position: absolute;
    top: 180px;
    bottom: 0;
    left: 0;
    right: 0;
    /* Gradient fra transparent til delvis hvit for "tåke"-effekt */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.8) 100%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thac-lock-msg {
    text-align: center;
    margin-top: 40px;
}

.thac-lock-msg h3 {
    color: #d35400;
    margin: 0 0 10px 0;
    text-shadow: 0 0 5px #fff;
    font-size: 1.4rem;
}

.thac-small-btn {
    height: 40px !important;
    font-size: 1rem !important;
    background-color: #e67e22;
    padding: 0 25px !important;
    min-width: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Premium Banner */
.thac-premium-banner {
    background: #fff8e1;
    border: 2px solid #e67e22;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.thac-banner-content h3 {
    color: #d35400;
    margin: 0 0 5px 0;
}

.thac-banner-content p {
    margin: 0;
    color: #555;
}

.thac-premium-btn {
    background-color: #e67e22;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3);
}

.thac-premium-btn:hover {
    background-color: #d35400;
}

/* --- 7. ANIMASJONER & LOADER --- */
.thac-step {
    display: none;
    animation: thacFadeIn 0.5s;
}

.thac-step.active {
    display: block;
}

@keyframes thacFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.thac-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #27ae60;
    border-radius: 50%;
    animation: thacSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes thacSpin {
    to { transform: rotate(360deg); }
}

/* --- 8. RESPONSIVITET --- */
@media (max-width: 600px) {
    .thac-wrapper {
        padding: 1.5rem;
        margin: 15px auto;
    }

    .thac-nav {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .thac-button {
        width: 100%;
    }

    .thac-premium-banner {
        flex-direction: column;
        text-align: center;
    }

    .thac-score-grid {
        flex-direction: column;
    }

    .thac-stat {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .thac-stat:last-child {
        border-bottom: none;
    }
    
    .thac-main-title {
        font-size: 2rem;
    }
}