/* Copy Button Styles */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    margin-left: 10px;
    vertical-align: middle;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.copy-btn-small {
    padding: 4px 8px;
    font-size: 0.75em;
}

/* Floating copy button for templates/emails */
.copyable-block {
    position: relative;
}

.copyable-block .copy-btn-float {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    font-size: 0.85em;
    z-index: 10;
}

/* Toast notification for copy success */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-toast::before {
    content: "✓";
    font-size: 1.1em;
}

/* Header with copy button */
.template-header-with-copy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--teal, #0D9488);
    color: white;
    padding: 12px 20px;
    margin: -25px -25px 20px -25px;
    border-radius: 8px 8px 0 0;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
}

.template-header-with-copy .copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.template-header-with-copy .copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   MOBILE FIXES - COPY BUTTON
   ========================================== */
@media (max-width: 768px) {

    /* Move floating copy button to bottom of block on mobile */
    .copyable-block .copy-btn-float {
        position: static;
        display: block;
        width: 100%;
        margin-top: 15px;
        text-align: center;
        justify-content: center;
    }

    /* Inline copy button - stack below text */
    .copy-btn {
        margin-left: 0;
        margin-top: 8px;
        display: inline-block;
    }

    /* Ensure template headers don't overflow */
    .template-header-with-copy {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .template-header-with-copy .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   TABLE HOVER CONTRAST FIX
   ========================================== */
.styled-table tbody tr:hover {
    background: #E8F5E9 !important;
}

.styled-table tbody tr:hover td {
    color: #1F2937 !important;
}

/* Light theme table hover fix */
.light-theme .styled-table tbody tr:hover,
body:not(.dark-mode) .styled-table tbody tr:hover {
    background: #E0F2FE !important;
}

.light-theme .styled-table tbody tr:hover td,
body:not(.dark-mode) .styled-table tbody tr:hover td {
    color: #0F172A !important;
}

/* ==========================================
   BULLET OVERFLOW FIX
   ========================================== */
.styled-list,
.check-list,
.cross-list,
ul {
    overflow: visible;
    padding-left: 20px;
}

.styled-list li,
.check-list li,
.cross-list li {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Prevent list markers from overflowing container */
.section ul,
.section ol,
.info-box ul,
.info-box ol {
    padding-left: 25px;
    list-style-position: inside;
}

/* ==========================================
   HORIZONTAL OVERFLOW FIX
   ========================================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .main-content {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .section,
    .info-box,
    .story-box,
    .template-box,
    .checklist-grid,
    .kpi-grid {
        max-width: 100%;
        overflow-x: auto;
    }

    /* Fix wide tables on mobile */
    .styled-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 100%;
    }

    /* ==========================================
       DAILY INSPIRATION SECTION MOBILE FIX
       ========================================== */
    /* Fix grid layout in inspiration section */
    #inspiration [style*="grid-template-columns"],
    .section [style*="grid-template-columns: repeat(auto-fit, minmax(250px"] {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Fix inspiration quote cards */
    #inspiration>div[style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Ensure blockquotes don't overflow */
    blockquote {
        font-size: 18px !important;
        word-wrap: break-word;
    }

    /* Fix any inline grid that might break on mobile */
    [style*="display: grid"][style*="minmax(250px"] {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ==========================================
   BACK BUTTON - USE HISTORY NAVIGATION
   ========================================== */
/* Note: This requires JS fix - CSS only for styling */
.sidebar-back,
.back-link a {
    cursor: pointer;
}