/* ================================================
   Name Origin Finder - Main Stylesheet
   Unique Design: Amber Accent, Rounded Modern Style
   ================================================ */

/* === CSS Variables === */
:root {
    --primary-color: #F59E0B;      /* Amber */
    --primary-dark: #D97706;       /* Darker Amber */
    --primary-light: #FCD34D;      /* Light Amber */
    --bg-color: #F9FAFB;           /* Light Gray */
    --bg-white: #FFFFFF;
    --text-dark: #1F2937;          /* Dark Gray */
    --text-medium: #4B5563;        /* Medium Gray */
    --text-light: #6B7280;         /* Light Gray */
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --error-color: #EF4444;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* === Accessibility === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Header === */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 70px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.25rem;
    transition: var(--transition);
}

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

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-weight: 700;
}

/* === Navigation === */
.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* === Hamburger Menu === */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* === Hero Section === */
.hero-section {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 4rem 0 5rem;
    text-align: center;
}

.main-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.intro-text {
    font-size: 1.125rem;
    color: var(--text-medium);
    max-width: 900px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

/* === Tool Container === */
.tool-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.tool-card {
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 700px;
    width: 100%;
}

.tool-heading {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.name-form {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.name-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-color);
    color: var(--text-dark);
    transition: var(--transition);
    outline: none;
}

.name-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.name-input::placeholder {
    color: var(--text-light);
}

.input-help {
    display: block;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: left;
}

/* === Buttons === */
.btn-primary {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--bg-white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-reset {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    color: var(--text-medium);
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.btn-reset:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* === Result Area === */
.result-area {
    min-height: 50px;
}

.result-card {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1.5rem;
    border: 2px solid var(--primary-light);
    animation: fadeIn 0.4s ease-in;
}

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

.result-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-name-icon {
    font-size: 2rem;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.result-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.result-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.result-content p {
    font-size: 1rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.error-message {
    background: #FEE2E2;
    border: 2px solid #FCA5A5;
    color: #991B1B;
    padding: 1.5rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 500;
}

/* === Content Sections === */
.content-section {
    padding: 4rem 0;
}

.content-section.alt-bg {
    background: var(--bg-white);
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.section-text {
    font-size: 1.0625rem;
    color: var(--text-medium);
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

/* === Lists === */
.ordered-list,
.feature-list {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.ordered-list li {
    font-size: 1.0625rem;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.feature-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 16px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.feature-list li:hover {
    border-color: var(--primary-light);
    background: var(--bg-white);
    transform: translateX(8px);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-content {
    flex: 1;
}

.feature-content strong {
    color: var(--text-dark);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

/* === Example Grid === */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.example-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.example-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.example-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.example-origin {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.example-meaning {
    font-size: 0.95rem;
    color: var(--text-medium);
    line-height: 1.6;
}

/* === Credibility Info === */
.credibility-info {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 16px;
    border-left: 4px solid var(--primary-color);
    margin-top: 1.5rem;
}

.credibility-info strong {
    color: var(--text-dark);
}

/* === FAQ Section === */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.faq-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.faq-answer {
    font-size: 1rem;
    color: var(--text-medium);
    line-height: 1.7;
}

/* === Page Sections (for static pages) === */
.page-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.page-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.page-content {
    max-width: 800px;
    font-size: 1.0625rem;
    color: var(--text-medium);
    line-height: 1.8;
}

.page-content p {
    margin-bottom: 1.25rem;
}

.contact-email {
    font-size: 1.25rem;
    margin: 2rem 0;
}

.contact-email a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.contact-email a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* === Footer === */
.site-footer {
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 2.5rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.copyright {
    font-size: 0.95rem;
    color: #D1D5DB;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    align-items: center;
}

.footer-nav a {
    color: var(--bg-white);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: var(--primary-light);
}

.footer-nav .separator {
    color: #6B7280;
}

/* === Back to Top Button === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* === Responsive Design === */
@media (max-width: 768px) {
    /* Header */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        text-align: center;
    }

    .nav-menu a::after {
        display: none;
    }

    /* Hero */
    .main-heading {
        font-size: 1.875rem;
    }

    .intro-text {
        font-size: 1rem;
    }

    .tool-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }

    /* Content */
    .section-heading {
        font-size: 1.75rem;
    }

    .page-heading {
        font-size: 2rem;
    }

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

    /* Footer */
    .footer-nav {
        font-size: 0.875rem;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .main-heading {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .name-input,
    .btn-primary {
        font-size: 0.95rem;
    }
}

/* === Print Styles === */
@media print {
    .site-header,
    .hamburger,
    .back-to-top,
    .tool-container {
        display: none;
    }
}