/* AI Text Cleaner Tool Styles */

/* Tab Navigation Styling */
.tab-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid transparent;
    color: #9CA3AF; /* gray-400 */
    background: transparent;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.tab-button:hover {
    color: #D1D5DB; /* gray-300 */
    border-bottom-color: #6B7280; /* gray-500 */
}

.tab-button.active {
    color: #3B82F6; /* blue-500 */
    border-bottom-color: #3B82F6; /* blue-500 */
    background: rgba(59, 130, 246, 0.1);
}

.tab-button i {
    font-size: 0.875rem;
}

/* Mobile responsive tabs */
@media (max-width: 640px) {
    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .tab-button span {
        display: none;
    }
    
    .tab-button i {
        margin-right: 0 !important;
        font-size: 1rem;
    }
}

/* Character Detection Results */
.character-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 0.5rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    margin-bottom: 0.5rem;
}

.character-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.character-preview {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    min-width: 3rem;
    text-align: center;
    border: 1px solid rgba(75, 85, 99, 0.5);
}

.character-details {
    flex: 1;
}

.character-name {
    font-weight: 600;
    color: #E5E7EB; /* gray-200 */
    font-size: 0.875rem;
}

.character-unicode {
    font-size: 0.75rem;
    color: #9CA3AF; /* gray-400 */
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.character-count {
    background: rgba(59, 130, 246, 0.2);
    color: #93C5FD; /* blue-300 */
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Checkbox styling for selective cleaning */
.character-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(55, 65, 81, 0.3);
    border-radius: 0.375rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-checkbox:hover {
    background: rgba(55, 65, 81, 0.5);
    border-color: rgba(75, 85, 99, 0.5);
}

.character-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background-color: white; /* Always white background */
    border: 2px solid #6B7280; /* gray-500 - visible border */
    border-radius: 3px;
    appearance: none; /* Remove default styling */
    transition: all 0.2s ease;
}

/* Custom checkmark styling */
.character-checkbox input[type="checkbox"]:checked {
    background-color: white; /* Keep white background when checked */
    border-color: #6B7280; /* Keep same border color */
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7.5 7.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6 10.293l7.146-7.147a.5.5 0 0 1 .708.708z' stroke='black' stroke-width='0.8' stroke-linejoin='round' stroke-linecap='round'/%3e%3c/svg%3e");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hover state for better UX */
.character-checkbox input[type="checkbox"]:hover {
    border-color: #9CA3AF; /* gray-400 - lighter border on hover */
    background-color: #F9FAFB; /* Very light gray on hover */
}

/* Focus state for accessibility */
.character-checkbox input[type="checkbox"]:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.character-checkbox-label {
    flex: 1;
    font-size: 0.875rem;
    color: #E5E7EB;
    cursor: pointer;
    user-select: none;
}

/* Copy button success state */
#copy-btn.copied {
    background-color: rgb(34 197 94) !important; /* green-500 */
    border-color: rgb(34 197 94) !important;
    color: white !important;
    animation: copy-success 2s ease-in-out;
}

@keyframes copy-success {
    0% { background-color: rgb(34 197 94); }
    20% { background-color: rgb(22 163 74); } /* green-600 */
    40% { background-color: rgb(34 197 94); }
    100% { background-color: rgb(55 65 81); } /* gray-700 */
}

/* Button hover animations */
.btn-primary, .btn-secondary {
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

/* Input and output textarea styling */
#input-text, #output-text {
    transition: border-color 0.2s ease;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.5;
}

#input-text:focus {
    border-color: #3B82F6 !important; /* blue-500 */
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.2);
}

#output-text {
    background-color: #1F2937 !important; /* gray-800 */
    border: 1px solid #4B5563; /* gray-600 */
}

/* Loading state for buttons */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Smooth transitions for content changes */
.content-transition {
    transition: opacity 0.2s ease-in-out;
}

.content-transition.fade-out {
    opacity: 0;
}

.content-transition.fade-in {
    opacity: 1;
}

/* Success notification styling */
.success-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: rgb(34 197 94); /* green-500 */
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    z-index: 1000;
    animation: slide-in 0.3s ease-out, slide-out 0.3s ease-in 2.7s forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Enhanced button styling to match existing tools */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #1E40AF);
    border: none;
    font-weight: 600;
    text-transform: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
}

.btn-secondary {
    background-color: rgb(55 65 81); /* gray-700 */
    border: 1px solid rgb(75 85 99); /* gray-600 */
    color: white;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: rgb(75 85 99); /* gray-600 */
    border-color: rgb(107 114 128); /* gray-500 */
}

/* Fix for missing responsive classes */
@media (min-width: 768px) {
    .md\:block {
        display: block !important;
    }
}

/* Ensure proper tab navigation visibility */
.hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .hidden.md\:block {
        display: block !important;
    }
}

/* Ensure dropdown is hidden on desktop */
@media (min-width: 768px) {
    .md\:hidden {
        display: none !important;
    }
}

/* Force tab display on desktop */
@media (min-width: 768px) {
    .tab-navigation-desktop {
        display: block !important;
    }
}

/* Force dropdown display on mobile */
@media (max-width: 767px) {
    .tab-navigation-mobile {
        display: block !important;
        position: relative !important;
    }
    .tab-navigation-desktop {
        display: none !important;
    }
}

/* Dropdown styling fixes */
#dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #374151; /* gray-700 */
    border: 1px solid #4B5563; /* gray-600 */
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    margin-top: 4px;
    overflow: hidden;
}

/* Ensure dropdown is visible when shown */
#dropdown {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Ensure dropdown is hidden when needed */
#dropdown.hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Ensure the dropdown container has relative positioning */
.tab-navigation-mobile {
    position: relative;
    width: 100%;
}

.dropdown-option {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #E5E7EB; /* gray-200 */
    font-size: 14px;
    display: flex;
    align-items: center;
    font-family: inherit;
}

.dropdown-option:hover {
    background-color: #4B5563; /* gray-600 */
    color: white;
}

.dropdown-option:focus {
    outline: none;
    background-color: #4B5563; /* gray-600 */
    color: white;
}

.dropdown-option i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* Custom dropdown button styling */
#dropdownDefaultButton {
    background: #374151 !important; /* gray-700 */
    border: 1px solid #4B5563 !important; /* gray-600 */
    color: #E5E7EB !important; /* gray-200 */
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

#dropdownDefaultButton:hover {
    background: #4B5563 !important; /* gray-600 */
    border-color: #6B7280 !important; /* gray-500 */
    color: white !important;
}

#dropdownDefaultButton:focus {
    outline: none !important;
    ring: 2px !important;
    ring-color: rgba(59, 130, 246, 0.5) !important;
    background: #4B5563 !important;
}

/* Style the dropdown arrow to be smaller and more elegant */
#dropdownDefaultButton svg {
    width: 12px !important;
    height: 12px !important;
    margin-left: 8px !important;
    opacity: 0.7 !important;
    transition: transform 0.2s ease !important;
}

/* Rotate arrow when dropdown is open */
#dropdownDefaultButton:not(.hidden) + #dropdown:not(.hidden) ~ #dropdownDefaultButton svg,
.dropdown-open svg {
    transform: rotate(180deg) !important;
}

/* Special styling for invisible characters display */
.invisible-char {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.visible-char {
    background: rgba(34, 197, 94, 0.2);
    color: #86EFAC;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Statistics display */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: rgba(55, 65, 81, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3B82F6;
}

.stat-label {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-top: 0.25rem;
}

/* Highlighted text display for detect tab */
.highlighted-text-display {
    width: 100%;
    min-height: 20rem;
    padding: 0.75rem 1rem; /* Match input-field padding */
    background-color: #1F2937; /* gray-800 - match textarea styling */
    border: 1px solid #4B5563; /* gray-600 - match #output-text border */
    border-radius: 0.5rem;
    color: #FFFFFF; /* white - match input-field text color */
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; /* Match textarea font-family */
    font-size: inherit; /* Use same font size as input field */
    line-height: 1.5; /* Match textarea line-height */
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: border-color 0.2s ease; /* Match textarea transition */
}

/* Highlighting styles for detected characters */
.detected-visible-char {
    background-color: rgba(34, 197, 94, 0.3); /* green background */
    color: #86EFAC; /* green-300 text */
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.5);
    cursor: help;
    position: relative;
}

.detected-invisible-char {
    background-color: rgba(239, 68, 68, 0.3); /* red background */
    color: #FCA5A5; /* red-300 text */
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.5);
    cursor: help;
    position: relative;
    font-size: 0.75rem;
}

/* Hover effects for highlighted characters */
.detected-visible-char:hover,
.detected-invisible-char:hover {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Tooltip styling for highlighted characters */
.detected-visible-char:hover::after,
.detected-invisible-char:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #374151; /* gray-700 */
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.25rem;
}
