/* GuessProg.dev Styles */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Inria+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Quicksand:wght@300..700&display=swap');

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

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 2rem 0;
}

.header .container {
    text-align: center;
}

.header pre {
    color: #aaff00;
    display: inline-block;
    text-align: left;
    cursor: crosshair;
}

.header pre .highlight {
    color: #ffaa00;
}

.header pre span:hover {
    color: #ffaa00;
}

.main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

.game-container {
    background: #fafafa;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.game-teaser {
    color: #667eea;
}

.info-section {
    background: #fafafa;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    padding: 0.5rem 0;
    border-left: 3px solid #667eea;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    background: #eaeaea;
}

/* Autocomplete styles */
.input-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    top: 1em;
}

.guess-input {
    width: 100%;
    padding: 12px 16px;
    margin-top: 0.75em;
    font-size: 16px;
    border: 2px solid #eaeaea;
    background-color: #eaeaea;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    outline: none;
}

.guess-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Victory message styles */
.victory-message {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.victory-content {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.victory-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.victory-content p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.victory-content strong {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.victory-subtitle {
    font-size: 1rem !important;
    opacity: 0.9;
    margin-top: 1rem !important;
    font-style: italic;
}

.autocomplete-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
}

.autocomplete-dropdown {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.autocomplete-item.highlighted {
    background-color: #f8f9ff;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item .autocomplete-language {
    margin-left: 5px;
}

/* Guesses container styles */
.guesses-container {
    margin-top: 2rem;
}

.guesses-container h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.guesses-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    color: #667eea;
}

.header-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-hint .header-hint-info {
    width: 15px;
    margin-left: 5px;
    cursor: help;
}

.guesses-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guess-item {
    font-family: "Fira Code", monospace;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.guess-item.correct {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.guess-item.incorrect {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.guess-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    min-height: 4rem;
}

.guess-language {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.guess-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
    font-size: x-small;
    min-height: 30px;
}

/* Column width definitions */
.header-name,
.language-name {
    min-width: 120px;
    flex: 0 0 120px;
}

.header-year,
.language-year {
    min-width: 80px;
    flex: 0 0 80px;
}

.header-paradigm,
.language-paradigm {
    min-width: 100px;
    flex: 0 0 100px;
}

.header-family,
.language-family {
    min-width: 90px;
    flex: 0 0 90px;
}

.header-memory-model,
.language-memory-model {
    min-width: 100px;
    flex: 0 0 100px;
}

.header-type-binding,
.language-type-binding {
    min-width: 90px;
    flex: 0 0 90px;
}

.header-type-safety,
.language-type-safety {
    min-width: 80px;
    flex: 0 0 80px;
}

.guess-hint.hint-match {
    background: rgba(144, 238, 144, 0.8);
    color: #2d5016;
    font-weight: 500;
}

.guess-hint.hint-no-match {
    background: rgba(255, 182, 193, 0.8);
    color: #8b1538;
    font-weight: 500;
}

.language-name {
    font-size: 0.9rem;
    font-weight: 600;
    background: none;
    gap: 0.5rem;
    justify-content: left;
}

.language-icon {
    width: 20px;
    height: 20px;
    border-radius: 20px;
    border: 3px white;
    background: rgba(255, 255, 255);
    flex-shrink: 0;
}

.language-year {
    position: relative;
    font-weight: 500;
}

.year-hint {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.arrow-up,
.arrow-down {
    cursor: help;
    border-radius: 3px;
    margin-left: 0.25rem;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #667eea;
}

.modal-body {
    padding: 2rem;
}

.modal-body h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.modal-body strong {
    color: #667eea;
    font-weight: 600;
}

.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .game-container,
    .info-section {
        padding: 1rem;
    }
}
