/* style.css - Stream Checklist for ES Brno */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #12cef1;
    --primary-dark: #009ebc;
    --primary-light: rgba(18, 206, 241, 0.08);
    --primary-glow: rgba(18, 206, 241, 0.25);

    --page-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #000000;
    --text-muted: #555555;
    --text-subtle: #777777;

    --card-border: rgba(18, 206, 241, 0.2);
    --card-hover-border: rgba(18, 206, 241, 0.45);
    --card-shadow: 0 12px 40px rgba(18, 206, 241, 0.08);
    --border-radius: 16px;
    --transition-speed: 0.25s;

    /* Signature Pill Style (Matching 'Otevřít YT Studio' reference) */
    --pill-bg: #ffffff;
    --pill-border: #12cef1;
    --pill-color: #009ebc;
    --pill-hover-bg: rgba(18, 206, 241, 0.1);
    --pill-hover-border: #12cef1;
    --pill-radius: 10px;

    /* Checkbox */
    --checkbox-border: #12cef1;
    --checkbox-bg: #ffffff;

    /* Guide Box */
    --how-to-bg: rgba(18, 206, 241, 0.035);
    --how-to-border: rgba(18, 206, 241, 0.16);
    --how-to-text: #2c3e50;

    /* Statuses */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */
html.dark-mode,
body.dark-mode {
    --page-bg: #090e15;
    --card-bg: #131b26;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    /* Subtle gray borders matching the user's reference screenshot */
    --card-border: #202d3d;
    --card-hover-border: #324458;
    --card-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);

    /* Gray pill borders in dark mode */
    --pill-bg: #141e2b;
    --pill-border: #253547;
    --pill-color: #12cef1;
    --pill-hover-bg: #192534;
    --pill-hover-border: #384e66;

    /* How-to Guide Box */
    --how-to-bg: #0e1621;
    --how-to-border: #1d2a38;
    --how-to-text: #cbd5e1;

    /* Checkbox */
    --checkbox-border: #28394c;
    --checkbox-bg: #141e2b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--page-bg);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
    background-image: radial-gradient(circle at 50% 0%, rgba(18, 206, 241, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Main Container Layout */
.container {
    width: 100%;
    max-width: 850px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    border-top: 8px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    transition: background-color var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

/* Header Styling */
header {
    text-align: center;
    margin-bottom: 25px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   SIGNATURE PILL STYLING (MATCHING 'OTEVŘÍT YT STUDIO')
   ========================================================================== */
.pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--pill-bg);
    color: var(--pill-color);
    border: 1.5px solid var(--pill-border);
    border-radius: var(--pill-radius);
    padding: 7px 16px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed);
    white-space: nowrap;
    user-select: none;
}

.pill-btn:hover {
    background-color: var(--pill-hover-bg);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(18, 206, 241, 0.2);
}

a.pill-btn:hover,
.app-launch-btn:hover {
    transform: translateY(-1px);
}

a.pill-btn:active,
.app-launch-btn:active {
    transform: translateY(0);
}

.pill-btn svg {
    color: currentColor;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ==========================================================================
   TOP STATUS & ACTIONS BAR
   ========================================================================== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.date-pill {
    cursor: default;
    background-color: var(--pill-bg);
}

.date-pill:hover {
    transform: none;
    background-color: var(--pill-bg);
    box-shadow: none;
}

.status-right-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Sync Status Pill */
.sync-pill {
    cursor: default;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sync-pill.connected .pulse-dot {
    background-color: var(--primary-color);
}

.sync-pill.connecting .pulse-dot {
    background-color: var(--warning-color);
}

.sync-pill.offline .pulse-dot {
    background-color: var(--text-subtle);
}

/* Theme Toggle Pill */
.theme-toggle-pill .sun-icon {
    display: none;
}
.theme-toggle-pill .moon-icon {
    display: block;
}

html.dark-mode .theme-toggle-pill .sun-icon,
body.dark-mode .theme-toggle-pill .sun-icon {
    display: block;
}
html.dark-mode .theme-toggle-pill .moon-icon,
body.dark-mode .theme-toggle-pill .moon-icon {
    display: none;
}

/* ==========================================================================
   PROGRESS OVERVIEW SECTION
   ========================================================================== */
.progress-section {
    background: linear-gradient(135deg, rgba(18, 206, 241, 0.05) 0%, rgba(18, 206, 241, 0.01) 100%);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.progress-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 6px;
}

.progress-counter {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-color);
}

.progress-percent {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

html.dark-mode .progress-percent,
body.dark-mode .progress-percent {
    color: var(--primary-color);
}

.progress-track {
    width: 100%;
    height: 10px;
    background-color: rgba(18, 206, 241, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #00d2f0 100%);
    border-radius: 10px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-subtle);
}

.auto-reset-hint {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auto-reset-hint svg {
    color: var(--primary-color);
}

/* Reset Pill Button */
.reset-pill {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.reset-pill:hover {
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.5);
    background-color: rgba(239, 68, 68, 0.08);
}

/* Completion Banner */
.completion-banner {
    display: none;
    margin-top: 16px;
    padding: 14px 18px;
    background-color: rgba(18, 206, 241, 0.08);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    align-items: center;
    gap: 14px;
}

.completion-banner.show {
    display: flex;
}

.banner-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.banner-text strong {
    display: block;
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 2px;
}

html.dark-mode .banner-text strong,
body.dark-mode .banner-text strong {
    color: var(--primary-color);
}

.banner-text span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ==========================================================================
   CHECKLIST ITEMS LIST
   ========================================================================== */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 35px;
}

.checklist-item {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 22px 24px;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.checklist-item:hover {
    box-shadow: 0 8px 24px rgba(18, 206, 241, 0.1);
    border-color: var(--card-hover-border);
}

.item-main {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

/* ==========================================================================
   FAJFKY / CHECKBOXES (STYLE OF THE PAGE, CYAN #12cef1, NOT BLUE)
   ========================================================================== */
.checkbox-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-checkbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
    margin: 0;
}

.custom-checkbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1.5px solid var(--checkbox-border);
    background-color: var(--checkbox-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Clicks hit native input directly */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.custom-checkbox svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    transition: stroke-dashoffset 0.22s ease;
}

.checkbox-wrapper:hover .custom-checkbox {
    border-color: var(--card-hover-border);
    box-shadow: 0 0 0 3px rgba(18, 206, 241, 0.2);
}

/* Checked State - In Page Cyan (#12cef1) */
.checklist-checkbox:checked + .custom-checkbox {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(18, 206, 241, 0.35);
}

.checklist-checkbox:checked + .custom-checkbox svg {
    stroke-dashoffset: 0;
    stroke: #000000; /* Crisp contrasting dark tick on vibrant cyan */
}

html.dark-mode .checklist-checkbox:checked + .custom-checkbox svg,
body.dark-mode .checklist-checkbox:checked + .custom-checkbox svg {
    stroke: #090e15;
}

/* Checklist Item Checked State */
.checklist-item.checked {
    background-color: rgba(18, 206, 241, 0.025);
}

.checklist-item.checked .task-title {
    color: var(--text-subtle);
    text-decoration: line-through;
    text-decoration-color: var(--primary-color);
    text-decoration-thickness: 2px;
}

.checklist-item.checked .step-num {
    background-color: rgba(18, 206, 241, 0.15);
    border-color: var(--primary-color);
}

/* ==========================================================================
   ITEM CONTENT
   ========================================================================== */
.item-content {
    flex: 1;
    min-width: 0;
}

.item-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.item-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1;
    min-width: 240px;
}

/* Step Number Badge */
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 8px;
    background-color: var(--pill-bg);
    color: var(--pill-color);
    border: 1.5px solid var(--pill-border);
    flex-shrink: 0;
}

.task-title {
    font-size: 1.12rem;
    font-weight: 700; /* Bold as requested: "Co udělat bude tučně" */
    line-height: 1.35;
    color: var(--text-color);
    margin: 0;
    cursor: pointer;
}

/* Play Icon for Launch Button */
.play-icon {
    font-size: 0.75rem;
    color: var(--pill-color);
}

/* ==========================================================================
   COMPANION LAUNCH BUTTONS (DESKTOP ONLY)
   ========================================================================== */
.app-launch-btn {
    display: none !important; /* STRICTLY HIDDEN BY DEFAULT */
}

/* Visible ONLY when desktop detected */
body.is-desktop .app-launch-btn {
    display: inline-flex !important;
}

.app-launch-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.app-launch-btn.success {
    background-color: rgba(18, 206, 241, 0.2);
}

/* Extra safety: never show on touch mobile devices */
@media (hover: none) and (pointer: coarse) {
    .app-launch-btn,
    .desktop-settings-bar {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .app-launch-btn,
    .desktop-settings-bar {
        display: none !important;
    }
}

/* "Jak to udělat" Guide Box */
.how-to-card {
    background-color: var(--how-to-bg);
    border: 1px solid var(--how-to-border);
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 4px;
}

.how-to-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.how-to-header svg {
    stroke: var(--primary-color);
}

.how-to-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--how-to-text);
}

.how-to-text strong {
    color: var(--text-color);
    font-weight: 700;
}

.how-to-text em {
    font-style: italic;
    color: var(--text-muted);
}

/* ==========================================================================
   TROUBLESHOOTING & HELP ASIDE
   ========================================================================== */
.troubleshooting-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-top: 25px;
    box-shadow: 0 4px 20px rgba(18, 206, 241, 0.06);
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.troubleshooting-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: rgba(18, 206, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.troubleshooting-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
}

.troubleshooting-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.troubleshooting-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.troubleshooting-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.troubleshooting-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    max-width: 100%;
}

.troubleshoot-pill {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
    padding: 8px 14px;
}

.pill-url-text {
    overflow-wrap: anywhere;
    word-break: break-word;
    display: inline;
}

.call-simon {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* ==========================================================================
   DESKTOP SETTINGS BAR
   ========================================================================== */
.desktop-settings-bar {
    display: none;
    justify-content: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed var(--card-border);
}

body.is-desktop .desktop-settings-bar {
    display: flex;
}

.companion-settings-pill {
    padding: 8px 18px;
    font-size: 0.85rem;
}

/* ==========================================================================
   MODAL OVERLAY & CARD
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background-color: var(--card-bg);
    color: var(--text-color);
    width: 100%;
    max-width: 550px;
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-subtle);
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--primary-color);
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.form-group input {
    font-family: inherit;
    font-size: 0.88rem;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-color);
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(18, 206, 241, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.primary-save-pill {
    background-color: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.primary-save-pill:hover {
    background-color: #00d2f0;
    color: #000;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background-color: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--card-border);
    max-width: 380px;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 12px 8px;
    }

    .container {
        padding: 20px 14px;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    h1 {
        font-size: 1.75rem;
    }

    .status-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .status-right-group {
        justify-content: space-between;
        gap: 8px;
    }

    .checklist-item {
        padding: 16px 14px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .item-main {
        gap: 12px;
    }

    .task-title {
        font-size: 1rem;
        line-height: 1.35;
        overflow-wrap: break-word;
    }

    .how-to-card {
        padding: 12px 14px;
    }

    .how-to-text {
        font-size: 0.9rem;
        overflow-wrap: break-word;
    }

    .troubleshooting-card {
        flex-direction: column;
        padding: 18px 14px;
        gap: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .troubleshooting-content h3 {
        font-size: 1.05rem;
        line-height: 1.3;
    }

    .troubleshooting-content p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .troubleshooting-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .troubleshoot-pill {
        width: 100%;
        box-sizing: border-box;
        font-size: 0.8rem;
        padding: 8px 10px;
        justify-content: flex-start;
        text-align: left;
    }

    .call-simon {
        font-size: 0.88rem;
    }
}
