/**
 * CV Creator Styles
 * Fixes layout issues and applies requested design refinements.
 */

/* 1. Mobile Footer Layout */
.mzd-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .mzd-footer {
        flex-direction: column;
        /* Stack buttons in DOM order (Submit, Reset, Back) */
        gap: 1rem;
    }

    .mzd-footer .mzd-btn {
        width: 100%;
        /* Full width buttons on mobile */
        justify-content: center;
        margin-left: 0;
        /* Override inline style on Back button */
    }
}

/* 2. Checkbox Font Size */
.mzd-row label:has(input[type="checkbox"]),
label:has(input[type="checkbox"]) {
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

/* 3. Step Labels on Mobile */
.mzd-stepper-item .mzd-step-label {
    display: block;
    /* Force display */
}

@media (max-width: 768px) {
    .mzd-stepper {
        overflow-x: auto;
        /* Allow scrolling if too wide */
        padding-bottom: 10px;
        /* Space for scrollbar if needed */
        justify-content: flex-start;
        /* Align start to allow scroll */
    }

    .mzd-stepper-item {
        min-width: 60px;
        /* Ensure touch target */
    }

    .mzd-step-label {
        font-size: 10px;
        /* Smaller font on mobile */
        margin-top: 4px;
        display: block;
    }
}

/* 4. Section Headings (h3 styled as h4) */
h3.mzd-section-title {
    font-size: var(--h4-size);
    /* Use responsive h4 size */
    font-weight: var(--font-weight-bold);
    margin-bottom: 1rem;
    color: var(--text);
}

/* General Fixes based on 'mzd-' class usage */
.mzd-form {
    max-width: 100%;
}

.mzd-step {
    display: none;
}

.mzd-step.active {
    display: block;
}

/* Button Styles - Matched to buttons.css */
.mzd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 2rem;
    height: 46px;
    font-size: var(--font-size-base, 1rem);
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    border-radius: var(--radius-md, 8px);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;

    /* Primary Style Default */
    background: var(--primary, #FDC600);
    color: var(--text, #161615);
    border-color: var(--primary, #FDC600);
}

.mzd-btn:hover {
    background: var(--primary-hover, #e5b300);
    border-color: var(--primary-hover, #e5b300);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(253, 198, 0, 0.3);
}

.mzd-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(253, 198, 0, 0.2);
}

/* Ghost Button Style */
.mzd-btn--ghost {
    background: transparent;
    color: var(--text, #161615);
    border-color: var(--border, #e2e8f0);
}

.mzd-btn--ghost:hover {
    background: var(--bg-subtle, #f8f9fa);
    border-color: var(--text-muted, #64748b);
    transform: translateY(-2px);
    box-shadow: none;
    /* Ghost usually doesn't have shadow or has different one */
}

.mzd-btn--ghost:active {
    background: var(--bg-surface, #ffffff);
    transform: translateY(0);
}

.mzd-row {
    margin-bottom: 1.5rem;
}

.mzd-row--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .mzd-row--two {
        grid-template-columns: 1fr;
    }
}

.mzd-required {
    color: var(--error);
}

/* Stepper Basic Styles */
.mzd-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.mzd-stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    /* If clickable */
}

.mzd-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.3s;
}

.mzd-stepper-item.active .mzd-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text);
}

.mzd-stepper-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 10px;
    position: relative;
    top: -10px;
    /* Adjust based on label height */
    z-index: 1;
}

/* Dynamic Rows & Remove Button */
.mzd-dynamic-row--flex {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* Desktop: Use plugin defaults for .mzd-remove-btn (absolute, small) */

@media (max-width: 768px) {
    .mzd-dynamic-row--flex {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        background: var(--bg-subtle);
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
    }

    .mzd-dynamic-row--flex>div {
        width: 100%;
        /* Override inline width */
    }

    .mzd-remove-btn {
        width: 100%;
        margin-top: 0.5rem;
        height: 40px;
        font-size: 1.25rem;
        background: white;
        position: static;
        /* Ensure static on mobile too */
        transform: none;
    }

    .mzd-remove-btn::after {
        content: " Odstrániť položku";
        font-size: 0.875rem;
        font-weight: 600;
        margin-left: 8px;
    }
}