/**
 * Overflow Detector - Styles for highlighting elements that overflow the viewport
 * 
 * Usage: Include this CSS file along with overflow-detector.js
 * Elements marked with data-overflow-right or .overflowing-right will be highlighted
 */

/* ==========================================================================
   Basic Overflow Highlighting
   ========================================================================== */

/**
 * Highlight elements with right margin overflow
 * The JavaScript adds this attribute with the overflow amount in pixels
 */
[data-overflow-right] {
    outline: 3px solid #ff4444 !important;
    outline-offset: 2px;
}

/**
 * Optional: Class-based marking (use with markClass option)
 */
.overflowing-right {
    background-color: rgba(255, 68, 68, 0.1) !important;
}

/* ==========================================================================
   Debug Overlay - Shows overflow amount
   ========================================================================== */

/**
 * Display overflow amount as a badge on the element
 * Uncomment to enable debug overlay
 */
/*
[data-overflow-right]::after {
    content: '→ ' attr(data-overflow-right) 'px';
    position: fixed;
    top: 0;
    right: 0;
    background: #ff4444;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 12px;
    font-family: monospace;
    font-weight: bold;
    z-index: 99999;
    border-radius: 0 0 0 4px;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.2);
}
*/

/* ==========================================================================
   Alternative Styles - Less Intrusive
   ========================================================================== */

/**
 * Subtle border highlight (alternative to outline)
 */
/*
[data-overflow-right] {
    border-right: 4px solid #ff9800 !important;
    border-right-color: rgba(255, 152, 0, 0.8) !important;
}
*/

/**
 * Background tint only (most subtle)
 */
/*
[data-overflow-right] {
    background-image: linear-gradient(
        to right,
        rgba(255, 68, 68, 0.05) 0%,
        rgba(255, 68, 68, 0.15) 100%
    ) !important;
}
*/

/* ==========================================================================
   Severe Overflow Warning
   ========================================================================== */

/**
 * Highlight elements that overflow by more than 100px
 * Requires JavaScript to add data-severity attribute
 */
/*
[data-overflow-right][data-severity="high"] {
    outline: 4px solid #ff0000 !important;
    outline-offset: 3px;
    animation: overflow-pulse 2s infinite;
}

@keyframes overflow-pulse {
    0%, 100% {
        outline-color: #ff0000;
    }
    50% {
        outline-color: #ff6666;
    }
}
*/

/* ==========================================================================
   Print Styles - Disable highlighting when printing
   ========================================================================== */

@media print {
    [data-overflow-right] {
        outline: none !important;
        background: none !important;
    }
    
    .overflowing-right {
        background: none !important;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/**
 * Container for overflow detector controls
 * Use this to add UI controls for toggling detection
 */
.overflow-detector-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 100000;
    background: #ffffff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: sans-serif;
    font-size: 14px;
}

.overflow-detector-controls h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.overflow-detector-controls button {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 8px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.overflow-detector-controls button:hover {
    background: #45a049;
}

.overflow-detector-controls button.stop {
    background: #f44336;
}

.overflow-detector-controls button.stop:hover {
    background: #da190b;
}

.overflow-detector-controls .count {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #666;
}

/* ==========================================================================
   Tooltip Style for Overflow Information
   ========================================================================== */

/**
 * Custom tooltip showing overflow details
 * Enable with JavaScript that adds title attribute
 */
/*
[data-overflow-right][title] {
    position: relative;
}

[data-overflow-right][title]:hover::before {
    content: attr(title);
    position: absolute;
    top: -30px;
    right: 0;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100001;
}
*/
