/* Prevent Google Translate from affecting Amharic characters */
.notranslate {
    -webkit-transform: none !important;
    transform: none !important;
}

.notranslate * {
    -webkit-transform: none !important;
    transform: none !important;
}

/* Ad spaces */
.ad-space {
    margin: 20px auto;
    text-align: center;
    border: 2px dashed #ccc;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

.ad-rectangle {
    width: 100%;
    max-width: 336px;
    height: 280px;
}

.ad-placeholder {
    color: #666;
    font-size: 14px;
    font-weight: bold;
}

/* Content section */
.content-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.content-section p {
    margin-bottom: 15px;
    color: #444;
    text-align: justify;
}

/* Footer links */
footer a {
    color: white;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

header {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

header p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

main {
    max-width: 1400px;
    margin: 10px auto;
    padding: 0 15px;
}

/* Text area styles */
.text-area-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#textOutput {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: 'Nyala', 'Ebrima', 'Noto Sans Ethiopic', sans-serif;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
    line-height: 1.4;
}

#textOutput:focus {
    border-color: #667eea;
}

.controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.controls button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.controls button:hover {
    background: #5a6fd8;
}

.controls button:active {
    transform: translateY(1px);
}

/* Keyboard container */
.keyboard-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Keyboard grid - 3 columns with horizontal families */
.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Letter family row - horizontal layout */
.letter-family {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    min-height: auto;
}

/* Individual letter button - smaller size */
.letter-btn {
    min-width: 35px;
    width: 35px;
    height: 35px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Nyala', 'Ebrima', 'Noto Sans Ethiopic', sans-serif;
    padding: 2px;
    flex-shrink: 0;
}

.letter-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.letter-btn:active {
    transform: translateY(0);
    background: #bbdefb;
}

/* Amharic letter styling - smaller */
.amharic-letter {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

/* English correspondent styling - smaller */
.english-letter {
    font-size: 0.5rem;
    color: #6c757d;
    font-weight: 300;
    margin-top: 1px;
    font-family: 'Segoe UI', sans-serif;
}

/* Special sections - span all 3 columns */
.numbers-section, .punctuation-section {
    grid-column: span 3;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 8px;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    justify-content: flex-start;
    overflow-x: auto;
}

.numbers-section .letter-btn,
.punctuation-section .letter-btn {
    background: #fff8e1;
}

.numbers-section .letter-btn:hover,
.punctuation-section .letter-btn:hover {
    background: #ffecb3;
}

/* Responsive design */
@media (max-width: 768px) {
    .keyboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .letter-btn {
        min-width: 32px;
        width: 32px;
        height: 32px;
    }
    
    .amharic-letter {
        font-size: 1rem;
    }
    
    .english-letter {
        font-size: 0.45rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    #textOutput {
        font-size: 1rem;
        min-height: 70px;
    }
    
    .letter-family {
        gap: 2px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .keyboard-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .letter-btn {
        min-width: 28px;
        width: 28px;
        height: 28px;
    }
    
    .amharic-letter {
        font-size: 0.9rem;
    }
    
    .english-letter {
        font-size: 0.4rem;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .controls button {
        flex: 1;
        min-width: 70px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .letter-family {
        gap: 1px;
        padding: 3px;
    }
}

footer {
    text-align: center;
    padding: 15px;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 20px;
    font-size: 0.8rem;
}