/* Invisible Character Viewer Styles - Improved Contrast */
.icv-container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, #000000 100%);
    border-radius: 16px;
    padding: 24px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2) !important;
    border: 2px solid rgba(255, 255, 255) !important;
    position: relative;
}

.icv-header {
    text-align: center;
    margin-bottom: 24px;
}

.icv-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.icv-eye-icon {
    font-size: 20px;
    opacity: 0.9;
}

.icv-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
    color: #f8f9ff;
}

.icv-input-section {
    margin-bottom: 24px;
}

.icv-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
    opacity: 0.95;
}

.icv-textarea-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.icv-textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 14px;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.icv-textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.icv-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #ffffff;
}

.icv-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: flex-end;
}

.icv-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    min-width: 90px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.icv-btn-primary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.icv-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    color:black;
}

.icv-btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.icv-btn-secondary:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    color: black;
}

.icv-results-section {
    margin-bottom: 20px;
}

.icv-results-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.icv-results-wrapper {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    position: relative;
}

.icv-results {
    background: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 16px;
    min-height: 80px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    position: relative;
}

.icv-results.wrap-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.icv-results:empty::before {
    content: "Paste your text above to see invisible characters highlighted here...";
    color: #a0aec0;
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
}

.icv-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 16px;
}

.icv-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #ffffff;
    opacity: 0.9;
}

.icv-stat-label {
    font-weight: 500;
}

.icv-options {
    display: flex;
    gap: 16px;
    align-items: center;
}

.icv-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #ffffff;
    opacity: 0.9;
    user-select: none;
}

.icv-checkbox input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    margin: 0;
    transition: all 0.2s ease;
}

.icv-checkbox input[type="checkbox"]:checked {
    background: #ffffff;
    border-color: #ffffff;
}

.icv-checkbox input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #667eea;
    font-size: 10px;
    font-weight: bold;
}

/* Invisible character highlighting - Better contrast */
.icv-invisible-char {
    background: #ff6b35 !important;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 0 1px;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 11px;
    cursor: help;
    position: relative;
    display: inline-block;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.icv-invisible-char.space {
    background: #4299e1 !important;
}

.icv-invisible-char:hover {
    background: #e53e3e !important;
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.icv-invisible-char.space:hover {
    background: #3182ce !important;
}

/* Tooltip - Better visibility */
.icv-tooltip {
    position: absolute;
    background: #2d3748;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    max-width: 200px;
    line-height: 1.4;
    border: 1px solid #4a5568;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.icv-tooltip.show {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .icv-container {
        margin: 10px;
        padding: 16px;
    }
    
    .icv-title {
        font-size: 20px;
    }
    
    .icv-actions {
        flex-direction: column;
    }
    
    .icv-btn {
        width: 100%;
    }
    
    .icv-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .icv-options {
        width: 100%;
        justify-content: space-between;
    }
}

/* Animation for character detection */
@keyframes detectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.icv-invisible-char.detected {
    animation: detectPulse 0.3s ease;
}

/* Loading state */
.icv-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.icv-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}