/* ============================================================
   SUPER EFFICIENT APP — UX ENHANCEMENTS CSS
   Drop this into your existing stylesheet or add as a 
   <style> block / linked CSS file
   ============================================================ */

/* -------------------------------------------
   MOBILE TAB NAVIGATION
   ------------------------------------------- */

/* Mobile hamburger button - hidden on desktop */
.se-mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #F7C948;
    color: #1a1a1a;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.se-mobile-menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.se-mobile-menu-btn.open {
    background: #1a1a1a;
    color: #F7C948;
}

/* Mobile tab drawer */
.se-mobile-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 999;
    max-height: 70vh;
    overflow-y: auto;
    padding: 16px 12px 80px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.se-mobile-drawer.open {
    transform: translateY(0);
}

.se-mobile-drawer-title {
    font-weight: 700;
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 8px 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.se-mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.se-mobile-drawer-item:hover,
.se-mobile-drawer-item:active {
    background: #FFF7ED;
}

.se-mobile-drawer-item.active {
    background: #F7C948;
    color: #1a1a1a;
    font-weight: 600;
}

.se-mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.se-mobile-drawer-overlay.open {
    opacity: 1;
}

@media (max-width: 768px) {
    .se-mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .se-mobile-drawer {
        display: block;
    }

    .se-mobile-drawer-overlay {
        display: block;
    }

    /* Make tabs scrollable horizontally on tablet */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}


/* -------------------------------------------
   TOAST NOTIFICATIONS
   ------------------------------------------- */

.se-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.se-toast {
    pointer-events: auto;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    animation: seToastIn 0.3s ease forwards;
    cursor: pointer;
}

.se-toast.removing {
    animation: seToastOut 0.3s ease forwards;
}

.se-toast-success {
    background: #065F46;
    color: #fff;
    border-left: 4px solid #10B981;
}

.se-toast-error {
    background: #991B1B;
    color: #fff;
    border-left: 4px solid #EF4444;
}

.se-toast-warning {
    background: #92400E;
    color: #fff;
    border-left: 4px solid #F59E0B;
}

.se-toast-info {
    background: #1E40AF;
    color: #fff;
    border-left: 4px solid #3B82F6;
}

@keyframes seToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes seToastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 768px) {
    .se-toast-container {
        top: auto;
        bottom: 80px;
        right: 12px;
        left: 12px;
    }

    .se-toast {
        min-width: auto;
        max-width: 100%;
    }
}


/* -------------------------------------------
   UNSAVED CHANGES MODAL
   ------------------------------------------- */

.se-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.se-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.se-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.se-modal-overlay.open .se-modal {
    transform: scale(1);
}

.se-modal h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1a1a1a;
}

.se-modal p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.se-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.se-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
}

.se-modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.se-modal-btn-secondary:hover {
    background: #e5e7eb;
}

.se-modal-btn-danger {
    background: #EF4444;
    color: #fff;
}

.se-modal-btn-danger:hover {
    background: #DC2626;
}

.se-modal-btn-primary {
    background: #F7C948;
    color: #1a1a1a;
}

.se-modal-btn-primary:hover {
    background: #E5B83A;
}


/* -------------------------------------------
   SESSION TIMEOUT WARNING BAR
   ------------------------------------------- */

.se-session-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #92400E;
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10002;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.se-session-bar.visible {
    transform: translateY(0);
}

.se-session-bar button {
    background: #fff;
    color: #92400E;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.se-session-bar button:hover {
    background: #FEF3C7;
}


/* -------------------------------------------
   COPY BUTTON FEEDBACK
   ------------------------------------------- */

.se-copy-btn {
    position: relative;
    transition: all 0.2s;
}

.se-copy-btn.copied {
    background: #065F46 !important;
    color: #fff !important;
    border-color: #065F46 !important;
}


/* -------------------------------------------
   LOADING SKELETON PLACEHOLDERS
   ------------------------------------------- */

.se-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: seSkeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.se-skeleton-line {
    height: 16px;
    margin-bottom: 10px;
}

.se-skeleton-line:last-child {
    width: 60%;
}

.se-skeleton-block {
    height: 120px;
    margin-bottom: 16px;
}

@keyframes seSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.se-loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.se-loading-timer {
    font-size: 12px;
    color: #aaa;
}


/* -------------------------------------------
   AUTO-SAVE INDICATOR
   ------------------------------------------- */

.se-autosave-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

.se-autosave-indicator.visible {
    opacity: 1;
}

.se-autosave-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
}

@media (max-width: 768px) {
    .se-autosave-indicator {
        bottom: 80px;
        left: 12px;
    }
}


/* -------------------------------------------
   DRAFT RESTORE BANNER
   ------------------------------------------- */

.se-draft-banner {
    background: #FEF3C7;
    border: 1px solid #F7C948;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.se-draft-banner-text {
    color: #92400E;
    font-weight: 500;
}

.se-draft-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.se-draft-banner-actions button {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
}

.se-draft-restore-btn {
    background: #F7C948;
    color: #1a1a1a;
}

.se-draft-dismiss-btn {
    background: #fff;
    color: #666;
    border: 1px solid #ddd !important;
}


/* -------------------------------------------
   PRINT STYLES
   ------------------------------------------- */

@media print {
    /* Hide everything except the print content */
    body * {
        visibility: hidden;
    }

    .se-print-area,
    .se-print-area * {
        visibility: visible !important;
    }

    .se-print-area {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 20px;
    }

    /* Hide UI elements */
    .no-print,
    header,
    .tabs,
    .se-mobile-menu-btn,
    .se-mobile-drawer,
    .se-toast-container,
    .se-session-bar,
    .se-autosave-indicator,
    .se-modal-overlay {
        display: none !important;
    }

    /* Print header */
    .se-print-header {
        text-align: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 2px solid #1a1a1a;
    }

    .se-print-header h1 {
        font-size: 20px;
        margin: 0 0 4px;
    }

    .se-print-header p {
        font-size: 12px;
        color: #666;
        margin: 0;
    }
}


/* -------------------------------------------
   FOCUS STATES (ACCESSIBILITY)
   ------------------------------------------- */

*:focus-visible {
    outline: 3px solid #F7C948;
    outline-offset: 2px;
}

/* Remove default outline when using mouse */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Skip to content link (screen readers) */
.se-skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    background: #F7C948;
    color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 14px;
    z-index: 10003;
    transition: top 0.2s;
    text-decoration: none;
}

.se-skip-link:focus {
    top: 0;
}
