@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Old+Hungarian&display=swap');

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

:root {
    --primary: #c41e3a;
    --primary-dark: #a01729;
    --secondary: #436f4d;
    --background: #f5f5f0;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --border: #ddd;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #e8e8dc 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 6px var(--shadow);
}

header h1 {
    font-size: 2.5em;
    color: var(--primary);
    margin-bottom: 10px;
    font-family: 'Times New Roman', serif;
}

header h2 {
    font-size: 1.8em;
    color: var(--text);
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
    align-items: center;
}

.links a {
    text-decoration: none;
    transition: all 0.3s;
}

.links a:not(:has(img)) {
    padding: 8px 20px;
    background: var(--secondary);
    color: white;
    border-radius: 5px;
}

.links a:not(:has(img)):hover {
    background: #355a3c;
    transform: translateY(-2px);
}

.links a img {
    display: block;
    transition: transform 0.2s;
}

.links a img:hover {
    transform: scale(1.05);
}

.links .bmc-btn {
    transform: scale(0.7);
    transform-origin: center;
}

main section {
    background: var(--card-bg);
    padding: 30px;
    margin-bottom: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 6px var(--shadow);
}

main section h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.converter {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
}

.bottom-controls {
    grid-column: 1 / -1;
    display: flex;
    gap: 30px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
    align-items: center;
}

.examples-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.examples-inline strong {
    color: var(--text);
    white-space: nowrap;
}

.examples-inline .example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.options-inline {
    display: flex;
    align-items: center;
}

.converter-panel {
    display: flex;
    flex-direction: column;
}

.converter-panel h3 {
    margin: 0 0 10px 0;
    color: var(--text);
    font-size: 1.2em;
    border: none;
    padding: 0;
}


.clear-btn {
    padding: 5px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.clear-btn:hover {
    background: #c0392b;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1em;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.old-hungarian-text {
    font-family: 'Segoe UI Historic', 'Noto Sans Old Hungarian', serif;
    font-size: 1.5em;
    line-height: 1.8;
}

.char-count {
    text-align: right;
    color: #999;
    font-size: 0.9em;
    margin-top: 5px;
}

.arrow {
    font-size: 2em;
    color: var(--secondary);
    font-weight: bold;
}

.checkbox-group {
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1em;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
    margin-left: 10px;
}

.checkbox-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-buttons button,
button:not(.clear-btn) {
    padding: 10px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s, transform 0.1s;
}

.example-buttons button:hover {
    background: #355a3c;
    transform: translateY(-2px);
}

.example-buttons button:active {
    transform: translateY(0);
}

.number-converter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.number-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.number-input-group label {
    font-weight: bold;
    color: var(--text);
}

.number-input-group input {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s;
}

.number-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.number-output {
    min-height: 50px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI Historic', 'Noto Sans Old Hungarian', serif;
}

#character-table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.character-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.character-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--shadow);
}

.character-card .old-hungarian {
    font-size: 2em;
    font-family: 'Segoe UI Historic', 'Noto Sans Old Hungarian', serif;
    margin-bottom: 8px;
    color: var(--primary);
}

.character-card .latin {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

.installation {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 6px var(--shadow);
}


.installation code {
    background: #f4f4f4;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary);
}

footer img {
    transition: transform 0.2s;
}

footer img:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .converter {
        grid-template-columns: 1fr;
    }

    .arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .bottom-controls {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .examples-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .options-inline {
        grid-column: 1;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 15px;
    }

    .number-converter {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.8em;
    }

    header h2 {
        font-size: 1.3em;
    }

    #character-table {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .links .bmc-btn {
        transform: scale(0.72);
    }
}