/* ============================================
   Text Case Converter - Global Styles
   ============================================ */

:root {
    --primary-color: #C62E2E;
    --secondary-color: #1e1e1e;
    --accent-color: #C1E172;
    --background-light: #f8f9fa;
    --text-dark: #1e1e1e;
    --text-muted: #6c757d;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --transition: all 0.3s ease;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--background-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #9a2424 100%);
    padding: 80px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: snow;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto 30px;
}

.hero-icon {
    margin-top: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   Tool Section
   ============================================ */

.tool-section {
    padding: 60px 20px;
    background-color: var(--white);
}

.tool-card {
    background: var(--white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.input-section {
    margin-bottom: 30px;
}

.input-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.text-input {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    resize: vertical;
    transition: var(--transition);
    background-color: var(--background-light);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(198, 46, 46, 0.1);
}

.character-count {
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
}

.character-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* ============================================
   Conversion Buttons
   ============================================ */

.conversion-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.convert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.convert-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.convert-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-weight: 700;
    font-size: 1rem;
}

/* ============================================
   Action Buttons
   ============================================ */

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn {
    background: var(--primary-color);
    color: var(--white);
}

.primary-btn:hover {
    background: #9a2424;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background: var(--background-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.secondary-btn:hover {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

/* ============================================
   Notification
   ============================================ */

.notification {
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
    margin-top: 20px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   Features Section
   ============================================ */

.features-section {
    padding: 80px 20px;
    background-color: var(--background-light);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(198, 46, 46, 0.1);
    border-radius: 50%;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   How to Use Section
   ============================================ */

.how-to-section {
    padding: 80px 20px;
    background-color: var(--white);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #9a2424);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-sm);
}

.step-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.step-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   Content Section
   ============================================ */

.content-section {
    padding: 80px 20px;
    background-color: var(--background-light);
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    padding: 50px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.content-wrapper h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.content-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 35px;
    margin-bottom: 20px;
}

.content-wrapper p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.content-wrapper strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================
   FAQ Section
   ============================================ */

.faq-section {
    padding: 80px 20px;
    background-color: var(--white);
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 24px 20px;
}

.faq-answer p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ============================================
   CTA Section
   ============================================ */

.cta-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="rgba(193,225,114,0.1)"/></svg>') repeat;
    opacity: 0.2;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: snow;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 35px;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.cta-primary,
.cta-secondary {
    padding: 16px 36px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.cta-primary {
    background: var(--primary-color);
    color: var(--white);
}

.cta-primary:hover {
    background: #9a2424;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--accent-color);
}

.cta-secondary:hover {
    background: var(--accent-color);
    color: var(--secondary-color);
}

.cta-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item strong {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-item span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .tool-card {
        padding: 24px;
    }

    .conversion-buttons {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .convert-btn {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        justify-content: center;
    }

    .content-wrapper {
        padding: 30px 20px;
    }

    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-primary,
    .cta-secondary {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .conversion-buttons {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 60px 20px 40px;
    }

    .cta-stats {
        gap: 20px;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.convert-btn:focus,
.primary-btn:focus,
.secondary-btn:focus,
.faq-question:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.text-input:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .hero-section,
    .cta-section,
    .action-buttons,
    #site-header,
    #site-footer,
    .get-template {
        display: none;
    }

    .tool-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}