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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: background-color 0.1s;
}

#input-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    padding: 10px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

#input-bar.visible {
    transform: translateY(0);
}

#text-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

#text-input:focus {
    border-color: #007AFF;
}

#settings-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background-color 0.2s;
}

#settings-btn:hover {
    background: #e0e0e0;
}

#display-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    overflow: hidden;
}

#big-text {
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    transition: color 0.1s;
    max-width: 100%;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

#close-settings {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

#close-settings:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 20px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.setting-group input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
}

.setting-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    outline: none;
}

.setting-group select:focus {
    border-color: #007AFF;
}

.lang-flags {
    display: flex;
    gap: 10px;
}

.lang-flag {
    width: 60px;
    height: 50px;
    font-size: 32px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-flag:hover {
    border-color: #999;
}

.lang-flag.active {
    border-color: #007AFF;
    background: #e8f4ff;
}

@media (orientation: landscape) {
    #input-bar {
        padding: 8px 20px;
    }

    #display-area {
        padding: 10px 40px;
    }
}

@media (prefers-color-scheme: dark) {
    #input-bar {
        background: rgba(30, 30, 30, 0.95);
    }

    #text-input {
        background: #333;
        border-color: #555;
        color: white;
    }

    #settings-btn {
        background: #444;
        color: white;
    }
}

#update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #007AFF;
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

#update-notification button {
    background: white;
    color: #007AFF;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
