/* WHSMACON - Main Stylesheet */

:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1a1a2e;
    --color-text-muted: #64748b;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-accent-light: #eff6ff;
    --gradient-hero: linear-gradient(135deg, #0ea5e9 0%, #2563eb 50%, #1e40af 100%);
    --gradient-card: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1 0 auto;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-accent-hover);
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: var(--shadow-lg);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-item {
    display: block;
    padding: 10px 14px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.nav-dropdown-item:hover {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 8px;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Main Content */
.main {
    padding-top: 64px;
}

/* Hero Section */
.hero {
    background: var(--gradient-hero);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: white;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* Section */
.section {
    padding: 80px 0;
}

.section:nth-child(even) {
    background: white;
}

.section-header {
    margin-bottom: 48px;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: var(--color-text);
}

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

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Card */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 28px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-hero);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.card-description {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
    padding: 6px 12px;
    background: var(--color-accent-light);
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.card-link:hover {
    background: var(--color-accent);
    color: white;
}

/* Article Card */
.article-card {
    display: block;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.article-card .card-meta {
    font-size: 0.8125rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* Tool Page Styles */
.tool-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 100px 24px 80px;
}

.tool-header {
    margin-bottom: 40px;
    text-align: center;
}

.tool-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-textarea,
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-textarea:focus,
.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-light);
}

.form-textarea {
    min-height: 140px;
}

.form-file {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.form-file:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
}

.form-file::file-selector-button {
    background: var(--color-accent);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 8px 16px;
    margin-right: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.form-file::file-selector-button:hover {
    background: var(--color-accent-hover);
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--color-text);
    padding: 8px 16px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.radio-label:has(input:checked) {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
}

.radio-label input {
    accent-color: var(--color-accent);
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border: none;
}

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

.btn:not(:disabled):hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--gradient-hero);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

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

.btn-secondary:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.result-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecef 100%);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    word-wrap: break-word;
    min-height: 100px;
    color: var(--color-text-muted);
}

.result-box.has-content {
    color: var(--color-text);
}

.error-text {
    color: #dc2626;
}

.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Article Styles */
.article-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 100px 24px 80px;
}

.article-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--color-border);
    text-align: center;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-meta {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.article-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text);
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
    margin: 3em 0;
}

.article-content i {
    font-style: italic;
}

.article-images {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.article-images a {
    flex: 1;
    min-width: 80px;
}

.article-images img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-md);
}

.article-images img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    padding: 48px 0;
    background: var(--color-text);
    text-align: center;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
}

.footer-text a {
    color: rgba(255, 255, 255, 0.9);
}

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

/* ============================================
   RESPONSIVE - Mobile Usability Fixes
   ============================================ */

/* Tablet */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Fix: Text too small to read */
    html {
        font-size: 16px;
    }
    
    body {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* Fix: Content wider than screen */
    .container,
    .tool-container,
    .article-container {
        padding-left: 16px;
        padding-right: 16px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Navigation - Compact mobile menu */
    .nav-inner {
        padding: 0 16px;
        height: 56px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: white;
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 8px 0;
        gap: 0;
        box-shadow: var(--shadow-lg);
        max-height: 85vh;
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    /* Mobile dropdown - collapsible */
    .nav-dropdown {
        border-bottom: 1px solid var(--color-border);
    }

    .nav-dropdown:last-child {
        border-bottom: none;
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .nav-link::after {
        content: '+';
        font-size: 1.25rem;
        font-weight: 300;
        color: var(--color-text-muted);
        transition: transform 0.2s;
    }

    .nav-dropdown.open .nav-link::after {
        content: '−';
    }

    /* Dropdown menu - hidden by default on mobile */
    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        margin: 0;
        background: var(--color-bg);
        border: none;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        min-width: auto;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    /* Compact dropdown items - 2 column grid for Tools */
    .nav-dropdown-menu {
        display: none;
        padding: 8px 12px 12px;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .nav-dropdown-item {
        padding: 10px 12px;
        font-size: 0.875rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-dropdown-item:hover {
        background: var(--color-accent-light);
    }

    .nav-dropdown-divider {
        display: none;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        min-height: 48px;
        margin-right: -8px;
    }


    /* Hero section */
    .hero {
        padding: 48px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    /* Main content padding */
    .main {
        padding-top: 56px;
    }

    /* Sections */
    .section {
        padding: 48px 0;
    }

    .section-header {
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-description {
        font-size: 1rem;
    }

    /* Grid - single column on mobile */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Cards */
    .card {
        padding: 20px;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .card-description {
        font-size: 0.9375rem;
        margin-bottom: 16px;
    }

    /* Fix: Card links need proper tap targets */
    .card-links {
        gap: 10px;
    }

    .card-link {
        padding: 10px 16px;
        font-size: 0.9375rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Tool pages */
    .tool-container {
        padding: 80px 16px 60px;
    }

    .tool-header {
        margin-bottom: 32px;
    }

    .tool-title {
        font-size: 1.5rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    /* Forms - Fix: Text too small to read */
    .form-label {
        font-size: 0.9375rem;
        margin-bottom: 10px;
    }

    .form-textarea,
    .form-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 14px;
        border-radius: 10px;
    }

    .form-textarea {
        min-height: 120px;
    }

    /* Fix: Radio/checkbox groups need spacing */
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        font-size: 1rem;
        padding: 12px 16px;
        min-height: 48px;
    }

    /* Fix: Buttons need 48px min tap target */
    .btn-group {
        flex-direction: column;
        gap: 10px;
        margin-top: 24px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
    }

    /* Result boxes */
    .result-box {
        padding: 16px;
        font-size: 0.875rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Articles */
    .article-container {
        padding: 80px 16px 60px;
    }

    .article-header {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .article-meta {
        font-size: 0.9375rem;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.8;
    }

    .article-images {
        gap: 8px;
    }

    /* Footer */
    .footer {
        padding: 32px 16px;
    }

    .footer-text {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
}

/* Small phones */
@media (max-width: 375px) {
    html {
        font-size: 15px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .tool-title,
    .article-title {
        font-size: 1.5rem;
    }

    .card {
        padding: 16px;
    }
}

