/* Find & Replace Tool Styles - Based on Word Counter */

/* Reset for our tool only */
.find-replace-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Tool Description Section - Header Only - RED THEME */
.tool-description-section {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 40px 0 20px;
    margin-bottom: 0;
}

.tool-description-section .find-replace-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
}

.tool-main-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.tool-subtitle {
    font-size: 1.2rem;
    margin-bottom: 0;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.4;
}

/* Main Container */
.find-replace-container {
    background-color: #f5f7fa;
    padding: 20px 0 40px;
    width: 100%;
}

.find-replace-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Layout - Tool and Sidebar */
.tool-layout {
    display: flex;
    gap: 30px;
    position: relative;
    margin-top: 20px;
}

.main-content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-area {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Input Section */
.input-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    width: 100%;
}

.input-section h2 {
    color: #e74c3c; /* RED THEME */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.5rem;
}

/* Textarea */
#findReplaceTextInput {
    width: 100%;
    min-height: 250px;
    padding: 18px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    transition: border 0.3s;
    line-height: 1.6;
    font-family: inherit;
    margin-bottom: 5px;
}

#findReplaceTextInput:focus {
    outline: none;
    border-color: #e74c3c; /* RED THEME */
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Privacy Notice */
.privacy-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 20px 0;
    padding: 12px 15px;
    background-color: #ffeaea;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #c0392b;
    animation: fadeIn 0.5s ease;
}

.privacy-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.privacy-text {
    line-height: 1.4;
}

/* Find & Replace Controls */
.find-replace-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .find-replace-controls {
        grid-template-columns: 1fr;
    }
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.control-group input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.control-group input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.options-group {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-option label {
    cursor: pointer;
    user-select: none;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.action-buttons .btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-align: center;
}

.btn-icon {
    font-size: 1.1rem;
}

.action-buttons .btn-primary {
    background-color: #e74c3c; /* RED THEME */
    color: white;
}

.action-buttons .btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(192, 57, 43, 0.2);
}

.action-buttons .btn-secondary {
    background-color: #ecf0f1;
    color: #34495e;
}

.action-buttons .btn-secondary:hover {
    background-color: #d5dbdb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-buttons .btn-clear {
    background-color: #95a5a6;
    color: white;
}

.action-buttons .btn-clear:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(149, 165, 166, 0.2);
}

.action-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading Indicator */
.find-replace-loading {
    display: none;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 10px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c; /* RED THEME */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: findReplaceSpin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes findReplaceSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.find-replace-loading p {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.95rem;
}

/* Results Display */
.results-display {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-top: 20px;
    border-left: 5px solid #e74c3c; /* RED THEME */
}

.results-display h3 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c; /* RED THEME */
    margin-bottom: 5px;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 600;
}

.matches-list {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.match-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eaeaea;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.match-item:last-child {
    border-bottom: none;
}

.match-item .line-number {
    color: #7f8c8d;
    font-weight: 600;
    margin-right: 10px;
    min-width: 30px;
    display: inline-block;
}

.match-highlight {
    background-color: #ffeaa7;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    color: #d35400;
}

.no-matches {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 20px;
}

/* Tool Description Content */
.tool-description-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.tool-description-content .tool-description {
    margin-bottom: 40px;
}

.tool-description-content .tool-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 20px;
}

.tool-description-content .tool-features {
    margin-top: 25px;
}

.tool-description-content .tool-features h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-description-content .tool-features ul {
    list-style-type: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.tool-description-content .tool-features li {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e74c3c; /* RED THEME */
    font-size: 0.95rem;
    line-height: 1.5;
}

.tool-description-content .tool-features li strong {
    color: #e74c3c; /* RED THEME */
}

/* How to Use Section */
.how-to-use-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.how-to-use-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    background: #e74c3c; /* RED THEME */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.step-content h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.step-content p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* FAQ Section */
.faq-section {
    background: white;
    border-radius: 12px;
    padding: 30px 25px;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.faq-section h2 {
    text-align: center;
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.faq-question {
    width: 100%;
    padding: 18px 0;
    text-align: left;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    transition: color 0.3s;
    position: relative;
}

.faq-question:hover {
    color: #e74c3c; /* RED THEME */
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    color: #e74c3c; /* RED THEME */
    display: inline-block;
}

.faq-question.active::after {
    content: '−';
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    opacity: 0;
    visibility: hidden;
}

.faq-question.active + .faq-answer {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease 0.1s, visibility 0.3s ease 0.1s;
}

.faq-answer p {
    padding: 0 0 20px 0;
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Sidebar Styles */
.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.sidebar-widget h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-list, .tools-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.tips-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    font-size: 0.9rem;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: #e74c3c; /* RED THEME */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
}

.tools-list a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Message Styles */
.message {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
    animation: fadeIn 0.5s ease;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CTA with Icon */
.start-tool-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 10px 0 25px 0;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.cta-icon {
    font-size: 1.5rem;
    color: #2ecc71;
    animation: bounce 2s infinite;
}

.cta-text {
    font-size: 1.3rem;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tool-layout {
        flex-direction: column;
    }
    
    .sidebar-area {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
        order: 2;
    }
    
    .main-content-area {
        order: 1;
    }
    
    .tool-main-title {
        font-size: 2.2rem;
    }
    
    .steps-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-description-content .tool-features ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .tool-description-section {
        padding: 30px 0 15px;
    }
    
    .tool-main-title {
        font-size: 1.8rem;
    }
    
    .tool-subtitle {
        font-size: 1rem;
    }
    
    .input-section,
    .results-display,
    .tool-description-content,
    .faq-section {
        padding: 20px;
    }
    
    .input-section h2,
    .results-display h3,
    .tool-description-content h2,
    .faq-section h2 {
        font-size: 1.4rem;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .sidebar-area {
        grid-template-columns: 1fr;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 15px 0;
    }
    
    .find-replace-controls {
        grid-template-columns: 1fr;
    }
    
    #findReplaceTextInput {
        min-height: 200px;
        padding: 15px;
        font-size: 15px;
    }
    
    .tool-description-content .tool-features ul {
        grid-template-columns: 1fr;
    }
    
    .tool-description-content .tool-description p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stat {
        padding: 15px;
    }
    
    .tool-main-title {
        font-size: 1.6rem;
    }
    
    .section-icon {
        font-size: 1.3rem;
    }
    
    .tool-subtitle {
        font-size: 0.95rem;
    }
    
    .options-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (min-width: 1200px) {
    .find-replace-wrapper {
        padding: 0;
    }
}

/* Print Styles */
@media print {
    .sidebar-area,
    .action-buttons .btn,
    .faq-section {
        display: none !important;
    }
    
    .find-replace-container {
        background: white;
        padding: 0;
    }
    
    .tool-description-section {
        background: white !important;
        color: black !important;
        padding: 20px 0 !important;
    }
}

/* Quick Breadcrumb Fix - Single Line */
.breadcrumb-container {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.breadcrumb-list {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    width: auto !important;
}

.breadcrumb-item {
    display: inline-flex !important;
    float: none !important;
}

.breadcrumb-list li {
    display: inline-flex !important;
    float: none !important;
}

/* Hide scrollbar */
.breadcrumb-container::-webkit-scrollbar {
    display: none;
}

.breadcrumb-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sticky-ad {
    position: sticky;
    top: 20px;
}