/* ===================================
   Find and Replace Text Tool - Styles
   =================================== */

/* CSS Variables */
:root {
    --primary-color: #C62E2E;
    --primary-dark: #8B1F1F;
    --secondary-color: #1e1e1e;
    --accent-color: #C1E172;
    --bg-light: #f8f9fa;
    --text-dark: #1e1e1e;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --white: #ffffff;
    --danger: #dc3545;
    --radius-sm: 8px;
    --radius-md: 12px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-small {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 5rem 0 4rem;
}

.hero-content {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: snow;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.feature-card:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feature-title {
    font-weight: 600;
    margin: 0.75rem 0 0.5rem;
}

.feature-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tool Section */
.tool-section {
    padding: 4rem 0;
}

.tool-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
    margin: 0;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-accent,
.btn-danger,
.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--text-muted);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--text-dark);
}

.btn-accent:hover {
    background-color: #a8c85f;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-large {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    font-size: 1rem;
    justify-content: center;
}

/* Text Areas */
.text-input,
.text-output {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: 'Courier New', Courier, monospace;
    resize: vertical;
    transition: var(--transition);
}

.text-input:focus,
.text-output:focus {
    outline: none;
    border-color: var(--primary-color);
}

.text-output {
    background-color: var(--bg-light);
    border-color: var(--accent-color);
}

.text-stats {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Rules Container */
#rulesContainer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-card {
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.rule-number {
    font-weight: 600;
    color: var(--primary-color);
}

.rule-remove-btn {
    padding: 0.25rem 0.75rem;
    background-color: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.rule-remove-btn:hover {
    background-color: #c82333;
}

.rule-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.input-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: 'Courier New', Courier, monospace;
    transition: var(--transition);
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rule-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Saved Patterns */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.pattern-card {
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.pattern-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.pattern-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.pattern-actions {
    display: flex;
    gap: 0.5rem;
}

.pattern-load-btn {
    flex: 1;
    padding: 0.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.pattern-load-btn:hover {
    background-color: var(--primary-dark);
}

.pattern-delete-btn {
    padding: 0.5rem;
    background-color: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pattern-delete-btn:hover {
    background-color: #c82333;
}

/* Stats Display */
.stats-display {
    padding: 1rem;
    background-color: var(--accent-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.stats-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.stats-item {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-box {
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.feature-box h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-box p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* How to Use Section */
.how-to-section {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step-card {
    position: relative;
    padding: 2rem;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.step-number {
    position: absolute;
    top: -20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.step-card h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 1rem 0 0.75rem;
    color: var(--text-dark);
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 5rem 0;
    color: var(--white);
}

.cta-content {
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: snow;
}

.cta-section p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn-primary,
.cta-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.cta-btn-primary {
    background-color: var(--white);
    color: var(--primary-color);
}

.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cta-btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.cta-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.faq-item:hover {
    background-color: #e9ecef;
}

.faq-item summary {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    margin-top: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Content Section */
.content-section {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.content-section article {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.content-section h2 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.content-section p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .cta-section h2 {
        font-size: 1.75rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rule-inputs {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .tool-section {
        padding: 2rem 0;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .features-section,
    .how-to-section,
    .faq-section,
    .content-section {
        padding: 2rem 0;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .cta-section,
    .button-group,
    .action-buttons {
        display: none;
    }

    .tool-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}