/* DoctorTimer - stile DoctorApp / Wiki
   Look pulito, bianco/grigio, card morbida, accento sanitario leggero. */

.timer-widget {
    --tdt-bg: #ffffff;
    --tdt-bg-soft: #f6f8f9;
    --tdt-border: rgba(120, 132, 145, 0.18);
    --tdt-border-strong: rgba(120, 132, 145, 0.28);
    --tdt-text: #26313f;
    --tdt-muted: #74808c;
    --tdt-accent: #0f9fa5;
    --tdt-accent-dark: #087d82;
    --tdt-shadow: 0 22px 55px rgba(31, 45, 61, 0.10);

    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 22px;
    box-sizing: border-box;
    text-align: center;
    color: var(--tdt-text);
    border: 1px solid var(--tdt-border);
    border-radius: 0;
    background:
        radial-gradient(circle at 16% 0%, rgba(15, 159, 165, 0.055), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.96));
    box-shadow: var(--tdt-shadow);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    overflow: hidden;
    font-family: inherit;
}

.timer-widget::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 80%, rgba(15, 159, 165, 0.045), transparent 42%);
    opacity: 0.55;
}


.timer-widget::after {
    content: "DoctorTimer";
    display: block;
    order: -1;
    align-self: center;
    margin-bottom: -4px;
    padding: 6px 13px;
    border: 1px solid rgba(15, 159, 165, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--tdt-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timer-widget .timer-inputs {
    display: grid;
    grid-template-columns: 1fr 92px 1fr 92px;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(120, 132, 145, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.70);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.timer-widget label {
    margin: 0;
    color: var(--tdt-muted);
    font-size: 13px;
    font-weight: 650;
    text-align: right;
}

.timer-widget input[type="number"] {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid var(--tdt-border);
    border-radius: 14px;
    outline: none;
    text-align: center;
    color: var(--tdt-text);
    background: #fff;
    box-shadow: 0 6px 14px rgba(31, 45, 61, 0.04);
    font-size: 16px;
    font-weight: 700;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.timer-widget input[type="number"]:focus {
    border-color: rgba(15, 159, 165, 0.55);
    box-shadow: 0 0 0 4px rgba(15, 159, 165, 0.12);
}

.timer-widget button {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 12px 18px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--tdt-accent), var(--tdt-accent-dark));
    box-shadow: 0 12px 26px rgba(15, 159, 165, 0.22);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.timer-widget button:hover {
    background: linear-gradient(135deg, #11adb4, #08767b);
    box-shadow: 0 16px 32px rgba(15, 159, 165, 0.28);
    transform: translateY(-1px);
}

.timer-widget button:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(15, 159, 165, 0.20);
}

#timer-display {
    margin: 0;
    padding: 18px 18px;
    border: 1px solid rgba(120, 132, 145, 0.15);
    border-radius: 24px;
    color: var(--tdt-text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 249, 250, 0.82));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 12px 30px rgba(31, 45, 61, 0.06);
    font-size: clamp(42px, 10vw, 64px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: -0.05em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.timer-widget label[for="volume-control"] {
    text-align: center;
    margin-top: 2px;
}

#volume-control {
    width: 100%;
    height: 6px;
    margin: -4px 0 0;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 159, 165, 0.45), rgba(120, 132, 145, 0.18));
    outline: none;
}

#volume-control::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--tdt-accent);
    box-shadow: 0 6px 18px rgba(31, 45, 61, 0.18);
    cursor: pointer;
}

#volume-control::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--tdt-accent);
    box-shadow: 0 6px 18px rgba(31, 45, 61, 0.18);
    cursor: pointer;
}

audio {
    display: none;
}

@media (max-width: 520px) {
    .timer-widget {
        width: 100%;
        margin: 16px auto;
        padding: 20px;
        border-radius: 24px;
    }

    .timer-widget .timer-inputs {
        grid-template-columns: 1fr 1fr;
    }

    .timer-widget label {
        text-align: left;
    }
}


/* Sidebar / widget-area layout
   Fill the widget container (about 434px in the current layout) and keep squared edges. */
.widget .timer-widget,
.widget-area .timer-widget,
.sidebar .timer-widget,
aside .timer-widget,
.wp-block-widget-area .timer-widget {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    border-radius: 0 !important;
    gap: 12px !important;
}

.widget .timer-widget .timer-inputs,
.widget-area .timer-widget .timer-inputs,
.sidebar .timer-widget .timer-inputs,
aside .timer-widget .timer-inputs,
.wp-block-widget-area .timer-widget .timer-inputs {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 12px !important;
}

.widget .timer-widget label,
.widget-area .timer-widget label,
.sidebar .timer-widget label,
aside .timer-widget label,
.wp-block-widget-area .timer-widget label {
    text-align: left !important;
    font-size: 12px !important;
}

.widget .timer-widget input[type="number"],
.widget-area .timer-widget input[type="number"],
.sidebar .timer-widget input[type="number"],
aside .timer-widget input[type="number"],
.wp-block-widget-area .timer-widget input[type="number"] {
    min-height: 38px !important;
    font-size: 14px !important;
}

.widget .timer-widget button,
.widget-area .timer-widget button,
.sidebar .timer-widget button,
aside .timer-widget button,
.wp-block-widget-area .timer-widget button {
    min-height: 42px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
}

.widget #timer-display,
.widget-area #timer-display,
.sidebar #timer-display,
aside #timer-display,
.wp-block-widget-area #timer-display {
    padding: 14px 10px !important;
    border-radius: 8px !important;
    font-size: clamp(38px, 8vw, 54px) !important;
}

/* Sidebar/widgets: fill the available container and keep the outer card squared. */
.widget .timer-widget,
.widget-area .timer-widget,
.sidebar .timer-widget,
aside .timer-widget,
.wp-block-widget-area .timer-widget {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
}


@media print {
    .timer-widget {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
    }
}


/* DoctorTimer category-like card for Wiki homepage
   Use this at the end of the homepage/category grid: [doctortimer_category url="/doctor-timer/"] */
.doctortimer-category-card {
    --dtc-bg: rgba(255, 255, 255, 0.88);
    --dtc-border: rgba(120, 132, 145, 0.18);
    --dtc-text: #26313f;
    --dtc-muted: #74808c;
    --dtc-accent: #0f9fa5;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 112px;
    padding: 18px 20px;
    box-sizing: border-box;
    order: 999;
    text-decoration: none !important;
    color: var(--dtc-text) !important;
    border: 1px solid var(--dtc-border);
    border-radius: 0;
    background:
        radial-gradient(circle at 12% 12%, rgba(15, 159, 165, 0.055), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 250, 0.86));
    box-shadow: 0 14px 34px rgba(31, 45, 61, 0.07);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.doctortimer-category-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(31, 45, 61, 0.10);
    border-color: rgba(15, 159, 165, 0.22);
}

.doctortimer-category-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--dtc-accent);
    background: rgba(15, 159, 165, 0.08);
    border: 1px solid rgba(15, 159, 165, 0.16);
}

.doctortimer-category-icon svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.doctortimer-category-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.doctortimer-category-title {
    font-size: 18px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.doctortimer-category-description {
    color: var(--dtc-muted);
    font-size: 13px;
    line-height: 1.35;
}

.doctortimer-category-label {
    margin-top: 4px;
    color: var(--dtc-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .doctortimer-category-card {
        min-height: 98px;
        padding: 16px;
    }
}


/* DoctorTimer live block for the Knowledge Base homepage. */
.doctortimer-home-timer {
    width: 100%;
    max-width: 100%;
    order: 999;
    box-sizing: border-box;
}

.doctortimer-home-timer .timer-widget {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.doctortimer-home-timer .widget,
.doctortimer-home-timer .widget_timer_widget {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* iKnowledge Base replacement: show only the timer, not the category header/list wrapper. */
.doctortimer-ikb-injected,
.doctortimer-replaced-whole-kb-panel {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    order: 999 !important;
}

.doctortimer-ikb-injected .timer-widget,
.doctortimer-replaced-whole-kb-panel .timer-widget {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

/* iKnowledge Base homepage: match category cards with rounded outer corners only there. */
.doctortimer-home-timer.doctortimer-ikb-injected,
.doctortimer-replaced-whole-kb-panel {
    border-radius: 10px !important;
    overflow: hidden !important;
}

.doctortimer-home-timer.doctortimer-ikb-injected .timer-widget,
.doctortimer-replaced-whole-kb-panel .timer-widget {
    border-radius: 10px !important;
    overflow: hidden !important;
}
