/* 
 * ==========================================
 * PRÉMIUM ABLAK KALKULÁTOR - CORE STYLES
 * ==========================================
 */

:root {
    --primary-color: #2563eb;
    /* Tailwind Blue-600 */
    --accent-color: #f97316;
    /* Tailwind Orange-500 */
    --text-dark: #1f2937;
    --bg-light: #f9fafb;
    --transition-speed: 0.3s;
}

/* --- 1. ÁR ELREJTÉSE (Blur Effect) --- 
   Ez a legfontosabb conversion elem. A homályosítás 
   kíváncsivá teszi a felhasználót.
*/
.price-blur {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    user-select: none;
    /* Ne lehessen kijelölni és másolni */
    pointer-events: none;
    opacity: 0.6;
    transition: all 0.5s ease;
}

.price-revealed {
    filter: blur(0);
    -webkit-filter: blur(0);
    opacity: 1;
    transform: scale(1.05);
    /* Kicsit "ugorjon" ki, amikor megjelenik */
    color: var(--primary-color);
}

/* --- 2. EGYEDI TOOLTIP (Info buborék) --- 
   Tailwind-del túl hosszú lenne a HTML class string.
   Ez a CSS kezeli a kis háromszöget és a megjelenést.
*/
.custom-tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.custom-tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #1e293b;
    /* Slate-800 */
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 50;
    bottom: 125%;
    /* A szöveg felett jelenjen meg */
    left: 50%;
    margin-left: -110px;
    /* Középre igazítás */
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* A kis nyíl a tooltip alján */
.custom-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Only show tooltip on devices with proper hover (not touch) */
@media (hover: hover) and (pointer: fine) {
    .custom-tooltip-container:hover .custom-tooltip-text {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    .group:hover .tooltip-content {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* --- 3. MODERN TOGGLE SWITCH (Jelölőnégyzet helyett) --- 
   Az "igen/nem" kapcsolókhoz (Redőny, Párkány).
   Sokkal jobban néz ki mobilon.
*/
.toggle-checkbox {
    appearance: none;
    -webkit-appearance: none;
    height: 1.5rem;
    /* 24px */
    width: 2.75rem;
    /* 44px */
    background-color: #d1d5db;
    /* Gray-300 */
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    vertical-align: middle;
}

.toggle-checkbox:checked {
    background-color: var(--primary-color);
}

/* A mozgó gombocska */
.toggle-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    /* 20px */
    height: 1.25rem;
    /* 20px */
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-checkbox:checked::after {
    transform: translateX(1.25rem);
    /* 20px jobbra */
}

/* --- 4. ANIMÁCIÓK (Slide Down / Fade In) --- 
   Amikor lenyílik a Redőny opció vagy hozzáadunk egy új ablakot.
*/
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-card {
    animation: slideIn 0.4s ease-out forwards;
    transition: box-shadow 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* --- 5. LOADING SPINNER --- 
   Ha az API épp számol.
*/
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- 6. ADMIN SPECIFIKUS --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
}

.admin-table tr:hover {
    background-color: #f3f4f6;
}

/* --- 7. INPUT FIELDS (Egységes stílus) --- */
.input-field {
    width: 100%;
    border: 1px solid #d1d5db;
    /* gray-300 */
    border-radius: 0.5rem;
    padding: 0.5rem;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.input-field:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    /* blue-500 ring */
    border-color: #3b82f6;
}

/* --- 8. LABELS (Egységes stílus) --- */
.label {
    display: flex;
    /* Flex, hogy az ikon mellé kerüljön */
    align-items: center;
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 700;
    color: #4b5563;
    /* gray-600 */
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

/* --- 9. TOOLTIP ANIMÁCIÓ (JS által generált) --- */
.tooltip-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s;
    transform: translateY(5px);
}

/* Note: The hover effect is now in @media (hover: hover) block above */

/* --- 10. RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .custom-tooltip-text {
        width: 180px;
        margin-left: -90px;
        font-size: 0.8rem;
    }

    /* Hide tooltips on mobile - they don't work well with touch */
    .tooltip-content,
    .custom-tooltip-text {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* Also hide the info icon on mobile since tooltip won't work */
    .group:has(.tooltip-content)>svg {
        display: none;
    }

    /* Fallback for browsers without :has() support */
    .label .group {
        display: none;
    }
}

/* ==========================================
   11. ONBOARDING & STEP INDICATOR STYLES
   ========================================== */

/* --- Step Progress Indicator --- */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.step-item {
    display: flex;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.step-circle.inactive {
    background-color: #e5e7eb;
    color: #9ca3af;
    border: 2px solid #d1d5db;
}

.step-circle.active {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    animation: stepPulse 2s ease-in-out infinite;
}

.step-circle.completed {
    background-color: #10b981;
    color: white;
    border: 2px solid #10b981;
}

.step-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    text-align: center;
}

.step-circle.active+.step-label,
.step-circle.active~.step-label {
    color: var(--primary-color);
}

.step-connector {
    width: 80px;
    height: 3px;
    background-color: #e5e7eb;
    margin: 0 8px;
    position: relative;
    top: -10px;
}

.step-connector.completed {
    background-color: #10b981;
}

@keyframes stepPulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1);
    }
}

/* --- Start Here Highlight --- */
.start-here-highlight {
    position: relative;
}

.start-here-highlight::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    animation: highlightPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes highlightPulse {

    0%,
    100% {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    50% {
        border-color: var(--accent-color);
        box-shadow: 0 0 20px 4px rgba(37, 99, 235, 0.2);
    }
}

/* --- Onboarding Tooltip Arrow --- */
.onboarding-tooltip {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    z-index: 100;
    animation: tooltipBounce 1s ease-in-out infinite;
}

.onboarding-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: #1d4ed8 transparent transparent transparent;
}

@keyframes tooltipBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* --- Welcome Overlay (First-time users) --- */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.welcome-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    margin: 1rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.welcome-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.welcome-steps {
    text-align: left;
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.welcome-step:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.welcome-step-number {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.welcome-step-text {
    font-size: 0.875rem;
    color: #374151;
}

.welcome-btn {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* --- Responsive for step indicator --- */
@media (max-width: 640px) {
    .step-indicator {
        gap: 0;
    }

    .step-connector {
        width: 40px;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* Hide onboarding elements on mobile */
    .onboarding-tooltip {
        display: none !important;
    }

    .start-here-highlight::before {
        display: none !important;
    }
}