/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --max-width: 1200px;
    --spacing: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    color: var(--text-color);
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Main Content */
.site-main {
    min-height: 60vh;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--text-light);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

/* Page Header */
.page-header {
    margin-bottom: 3rem;
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-light);
}

.tool-count {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Grids */
.benefits-grid,
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Cards */
.benefit-card,
.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card {
    display: block;
    color: var(--text-color);
}

.tool-card:hover,
.benefit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.tool-card h2,
.tool-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Category Section */
.category-section {
    margin-bottom: 4rem;
}

.category-header {
    margin-bottom: 2rem;
}

.category-header h2 {
    margin-bottom: 0.5rem;
}

.view-all {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Tool Page */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
}

.tool-header {
    margin-bottom: 2rem;
}

/* Tool Interface */
.tool-interface {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.tool-input-section,
.tool-output-section {
    margin-bottom: 1.5rem;
}

.tool-output-section:last-child {
    margin-bottom: 0;
}

.tool-interface label {
    display: block;
    margin-bottom: 0.5rem;
}

.tool-interface textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.tool-interface textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.output-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    min-height: 100px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 1rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    text-decoration: none;
}

.btn-cta {
    background-color: var(--success-color);
    color: white;
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

.btn-cta:hover {
    background-color: #059669;
    text-decoration: none;
    transform: translateY(-1px);
}

.error-message {
    background-color: #fee;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
}

.intro-text {
    font-size: 1.125rem;
    color: var(--text-light);
}

.steps-list,
.benefits-list,
.use-cases-list {
    padding-left: 1.5rem;
}

.steps-list li,
.benefits-list li,
.use-cases-list li {
    margin-bottom: 0.75rem;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.faq-item h3 {
    color: var(--primary-color);
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.faq-item p {
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 3rem;
}

.cta-section p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Related Tools */
.related-tools {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

/* Footer */
.site-footer {
    background-color: var(--text-color);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-col p,
.footer-col a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: white;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Intro Section */
.intro-section {
    margin-bottom: 4rem;
}

.intro-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .hero h1 {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        width: 100%;
        gap: 1rem;
    }

    .tools-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .tool-interface {
        padding: 1.5rem;
    }
}

/* Performance optimizations for Core Web Vitals */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent layout shift */
.tool-output-section,
.error-message {
    min-height: 0;
}

/* Client-Side Tool Styles */

/* Password Generator */
.password-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.option-group input[type="range"] {
    width: 100%;
    margin-top: 0.5rem;
}

.password-result {
    text-align: center;
}

.password-display {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    word-break: break-all;
    margin-bottom: 1rem;
}

.password-strength {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.password-info {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Text Stats (Word Counter) */
.text-stats {
    padding: 1rem 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Platform Limits */
.platform-limits {
    margin-top: 2rem;
}

.platform-limits h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.limits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.limit-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
}

.limit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.limit-name {
    font-weight: 600;
}

.limit-status {
    font-size: 0.875rem;
    color: var(--text-light);
}

.limit-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.limit-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.limit-item.limit-warning .limit-bar-fill {
    background: var(--error-color);
}

.limit-item.limit-exceeded .limit-bar-fill {
    background: #991b1b;
}

.limit-info {
    font-size: 0.75rem;
    color: var(--text-light);
}

.limit-item.limit-exceeded .limit-info {
    color: var(--error-color);
    font-weight: 600;
}

/* Navigation adjustments for 7 items */
@media (max-width: 1024px) {
    .main-nav {
        gap: 1rem;
    }
    
    .main-nav a {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .main-nav {
        gap: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    
    .main-nav a {
        font-size: 0.85rem;
    }
}
