/* ============================================
   OUH Base Design System
   Online Utilities Hub - Shared Styles
   ============================================ */

:root {
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --accent-primary: #1A5F9E;
    /* OUH Tech Blue */
    --accent-secondary: #3BBCA9;
    /* OUH Utility Cyan */
    --text-main: #212529;
    --text-muted: #6C757D;
    --border-color: #CED4DA;
    --error-color: #ef4444;
    --success-color: #9CD67E;
    /* OUH Growth Green */
    --cta-color: #3BBCA9;
    --cta-hover: #34A899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* OUH Header */
.ouh-header {
    background: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--success-color)) 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ouh-header a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.ouh-header img {
    height: 40px;
    width: auto;
}

.ouh-header .tool-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.ouh-header nav {
    margin-left: auto;
}

.ouh-header nav a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ouh-header nav a:hover {
    color: var(--accent-primary);
}

/* Ad Slots */
.ad-slot-leaderboard,
.ad-slot-sidebar {
    min-height: 0;
}

/* OUH Layout Grid */
.ouh-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1200px;
    width: 92%;
    margin: 2rem auto;
    align-items: start;
}

.ouh-main {
    min-width: 0;
}

/* Page Headings */
h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* OUH Card */
.ouh-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--cta-color);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 188, 169, 0.25);
}

.btn-primary:hover {
    background: var(--cta-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 188, 169, 0.3);
}

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

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: #ADB5BD;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

/* Copy Button */
.copy-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: var(--bg-color);
    border-color: var(--accent-secondary);
}

.copy-btn.copied {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

/* Form Elements */
.tool-input,
.tool-output {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--card-bg);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-input:focus,
.tool-output:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(59, 188, 169, 0.15);
}

.tool-output {
    background: var(--bg-color);
}

input[type="text"],
input[type="url"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(59, 188, 169, 0.15);
}

input[type="range"] {
    accent-color: var(--cta-color);
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Control Group */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Button Group */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--accent-primary);
}

/* Result/Output Area */
.result-area {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    word-break: break-all;
    min-height: 50px;
    position: relative;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--cta-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out both;
    opacity: 1; /* fallback if animation doesn't run */
}

/* SEO Content Section */
.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 1.35rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.seo-content ul,
.seo-content ol {
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.5rem;
}

/* Tool Grid (Landing Page) */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: block;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-secondary);
}

.tool-card .tool-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.tool-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Checkbox & Toggle Styles */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-main);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--cta-color);
    width: 18px;
    height: 18px;
}

/* Strength Meter */
.strength-meter {
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    overflow: hidden;
    margin-top: 0.5rem;
}

.strength-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* OUH Footer */
.ouh-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.ouh-footer-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ouh-footer-tools a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.ouh-footer-tools a:hover {
    background: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
}

.ouh-footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ouh-footer-links a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ouh-footer-links a:hover {
    color: var(--cta-color);
}

.ouh-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ouh-footer .privacy-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .ouh-layout {
        grid-template-columns: 1fr;
    }

    .ad-slot-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .ouh-card {
        padding: 1.5rem;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ouh-header {
        padding: 0.75rem 1rem;
    }

    .ouh-header img {
        height: 32px;
    }

    .ouh-layout {
        width: 95%;
        margin: 1.5rem auto;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
