/**
 * Anagramator - Stylesheet
 * Minimalist dark theme for word finder application
 */

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Layout
   ============================================================================ */

.wrapper {
    flex: 1;
    padding: clamp(20px, 8vh, 80px) 20px 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* ============================================================================
   Branding & Typography
   ============================================================================ */

.logo {
    width: clamp(35px, 8vw, 80px);
    height: auto;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 3.9rem);
    font-weight: 100;
    margin-bottom: 0.1rem;
    color: #ffffff;
}

.subtitle {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 100;
    color: #b3b3b3;
    margin-bottom: 2rem;
    line-height: 1.6;
}

h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 100;
    margin: 1.5rem 0 0.8rem;
    color: #ffffff;
}

.info-section:first-child h2 {
    margin-top: 0;
}

/* ============================================================================
   Input Section
   ============================================================================ */

.input-wrapper {
    margin-bottom: 2rem;
    position: relative;
}

input[type="text"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333333;
    color: #ffffff;
    font-size: clamp(1.63rem, 3.9vw, 2.28rem);
    font-weight: 600;
    padding: 1rem 0.5rem;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
    text-transform: uppercase;
}

input[type="text"]::placeholder {
    color: #666666;
    text-align: center;
    font-weight: 100;
}

input[type="text"]:focus {
    border-bottom-color: #4a9eff;
}

/* Clear button (X) */
.clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999999;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    transition: color 0.2s ease;
    line-height: 1;
    font-weight: 100;
}

.clear-btn:hover {
    color: #ffffff;
}

.clear-btn.visible {
    display: block;
}

/* ============================================================================
   Description & Info Sections
   ============================================================================ */

.description {
    font-size: clamp(1.14rem, 2.6vw, 1.3rem);
    font-weight: 100;
    color: #b3b3b3;
    margin-top: 50px;
    line-height: 1.8;
}

.info-section {
    margin-top: 2rem;
    text-align: left;
}

.info-section p {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 100;
    color: #b3b3b3;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.info-section a {
    color: #5bb3ff;
    text-decoration: underline;
    text-decoration-color: rgba(91, 179, 255, 0.3);
    text-underline-offset: 2px;
}

.info-section a:hover {
    color: #7dc7ff;
    text-decoration-color: rgba(125, 199, 255, 0.6);
}

.info-section a:focus {
    outline: 2px solid #5bb3ff;
    outline-offset: 2px;
}

/* ============================================================================
   Results Display
   ============================================================================ */

.results {
    margin-top: 2rem;
    text-align: center;
}

.results-header {
    font-size: 1.14rem;
    font-weight: 100;
    color: #999999;
    margin-bottom: 1.5rem;
    text-align: center;
}

.word-group {
    margin-bottom: 1.5rem;
}

.word-group-title {
    font-size: 1.14rem;
    color: #4a9eff;
    margin-bottom: 0.5rem;
    font-weight: 100;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.word-item {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1.14rem;
    font-weight: 100;
}

/* ============================================================================
   Status States (Loading & Error)
   ============================================================================ */

.loading {
    text-align: center;
    color: #999999;
    font-size: 1.14rem;
    font-weight: 100;
    margin-top: 2rem;
}

.error {
    text-align: center;
    color: #ff6b6b;
    font-size: 1.14rem;
    font-weight: 100;
    margin-top: 2rem;
}

.hidden {
    display: none;
}

/* ============================================================================
   Footer
   ============================================================================ */

footer {
    padding: 2rem 20px;
    border-top: 1px solid #2a2a2a;
    text-align: center;
    font-size: 0.875rem;
    color: #999999;
    font-weight: 100;
    margin-top: auto;
}

footer a {
    color: #5bb3ff;
    text-decoration: underline;
    text-decoration-color: rgba(91, 179, 255, 0.3);
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #7dc7ff;
    text-decoration-color: rgba(125, 199, 255, 0.6);
}

footer a:focus {
    outline: 2px solid #5bb3ff;
    outline-offset: 2px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.github-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.github-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 600px) {
    .wrapper {
        padding: clamp(10px, 2vh, 20px) 15px 15px;
    }

    .subtitle {
        margin-bottom: 1.5rem;
    }
    
    .input-wrapper {
        margin-bottom: 1.5rem;
    }
}


.sr-only {
    position:absolute;
    left:-9999px;
    width:1px;
    height:1px;
    overflow:hidden;
}