/* == RESET bàsic == */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body, #app {
    height: 100%;
}
:root {
    --bg-start: #fafafa;
    --bg-end: #f5f7fb;
    --blob-a-start: #6b21a8;
    --blob-b-start: #7c3aed;
}

/* Body i font per defecte (Montserrat com a fallback) */
body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

/* == Layout principal == */
.container {
    width: 100%;
    max-width: 980px;
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(20,25,40,0.08);
    overflow: hidden;
    position: relative;
}
.main {
    display: flex;
    flex-direction:row;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    padding: 36px;
}

/* == Left: controls + timer area == */
.left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
h1 {
    font-weight: 800;
    font-size: 2.5rem;
    color: #111;
}
.sub {
    color: #666;
    font-size: 0.95rem;
}

/* Card */
.card {
    background: rgba(255,255,255,0.6);
    border-radius: 14px;
    padding: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

#methodInput {
    font-family: inherit;
}

muted-2 details {
    user-select: none;
}

/* Gradient floating blobs (minimal, isolated) */
.bg-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.blob {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.12;
    mix-blend-mode: screen;
}
.blob--a {
    background: radial-gradient(circle at 30% 30%, var(--blob-a-start), #3b0066);
    left: -80px;
    top: -60px;
}
.blob--b {
    background: radial-gradient(circle at 70% 70%, var(--blob-b-start), #a78bfa);
    right: -80px;
    bottom: -120px;
}

/* Controls */
label {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
}
select, button {
    font-family: inherit;
}
.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
select, .btn, .dur-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(20,20,20,0.06);
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all .18s;
}
select:focus, .btn:focus, .dur-btn:focus {
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20,25,40,0.06);
}
.dur-btn {
    min-width: 72px;
    text-align: center;
}
#customMinutes {
    font-family: inherit;
}

/* Timer big */
.timer-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px;
    padding-top: 50px;
    padding-bottom: 50px;
    border-radius: 14px;
    max-height: 320px;
    min-height: 300px;
}

.timer-display {
    font-weight: 800;
    font-size: 4.6rem;
    letter-spacing: -0.02em;
    color: #111;
    transition: all .3s;
}
.timer-label {
    margin-top: 8px;
    color: #666;
}

/* Right column: history + settings button */
.right {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.history-list {
    max-height: 420px;
    overflow: auto;
    padding-right: 6px;
}
.history-item {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(20,20,20,0.03);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.muted {
    color: #8b8b8b;
    font-size: 0.85rem;
}

/* Fullscreen overlay (simulate dimming) */
.overlay {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.overlay .reveal {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: white;
}

/* Hidden state when timer active */
.hide-when-active {
    transition: opacity .15s, transform .15s;
}
.app-active .hide-when-active {
    opacity: 0;
    transform: scale(.98);
    pointer-events: none;
}

/* Settings drawer */
.drawer {
    position: fixed;
    right: -420px;
    top: 0;
    height: 100%;
    width: 420px;
    background: #fff;
    box-shadow: -20px 0 40px rgba(20,25,40,0.08);
    transition: right .28s;
    padding: 22px;
}
.drawer.open {
    right: 0;
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
}

/* Small screens */
@media (max-width:1000px) {
    /* La pàgina pot créixer segons contingut */
    html, body {
        height: auto;
        overflow-y: auto;
    }

    .container {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .main {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 24px;
        overflow: visible; /* molt important */
    }

    .left, .right {
        width: 100%;
        height: auto;
    }

    .right {
        order: 2; /* assegura que aparegui després de .left */
    }

    .timer-area {
        max-height: none;
        min-height: 200px;
    }
}



/* Tiny helpers */
.row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.sp { flex: 0; }
.muted-2 { color: #999; font-size: .86rem; }

/* aesthetic */
.timer-minimal {
    color: rgba(255,255,255,0.95);
    text-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* accessible focus */
button:focus, input:focus, select:focus {
    box-shadow: 0 10px 30px rgba(80,100,200,0.06);
}























/*ABOUT US*/
.aboutUs, .articleBody, .helpBody {
    height: 100%;
    width: 100%;
    text-align: left;
    background: rgba(255,255,255,0.6);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 30px rgba(20,25,40,0.08);
    overflow-y: scroll;
}

.aboutUs h2 {
    font-size: x-large;
}

.aboutUs summary {
    user-select: none;
    font-weight: 600;
}

.aboutUs details {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.aboutUs .versions a {
    text-decoration: none;
}

.aboutUs .versions--list a{
    display: block;
    width:fit-content;
    text-decoration: none;
    margin: 5px;
    padding: 10px;
    border-radius: 5px;
    background-color: #333333cc;
    color: #fff;
}

.aboutUs .contact p a {
    text-decoration: none;
}







/*ARTICLES*/
.autorSignature p {
    margin-left: 25px;
    color: #555;
    font-size: 0.95rem;
}

ol, ul {
    margin: 10px;
    margin-left: 30px;
}

.helpRoot {
    overflow: visible;
}

.helpBody {
    overflow-y: scroll;
}

.helpContents ul {
    list-style: none;
}

.helpContents li {
    margin-bottom: 10px;
    max-width: 250px;
}

.helpContents a {
    text-decoration: dotted;
    color: #111;
}

@media (max-width:900px) {
    .helpContents {
        display: none;
    }

    .right {
        width: 1vw;
    }
}