@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Special+Gothic+Expanded+One&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Special Gothic Expanded One', sans-serif;
}

body {
    font-family: 'Special Gothic Expanded One', sans-serif;
    margin: 0;
    background: #E8F4FA;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 450px;
    height: auto;
    min-height: 400px;
    padding: 30px;
    background: #FFFFFF;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 25px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 10px 10px 30px rgba(37, 37, 37, 0.3), -10px -10px 30px rgba(71, 74, 72, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out 2.5s forwards;
}

/* Loader Styles */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #E8F4FA;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 2s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.5); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2em;
    font-family: 'Special Gothic Expanded One', serif;
    color: #000000;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

h5 {
    padding-top: 15px;
    color: #000000;
    font-family: 'Special Gothic Expanded One', sans-serif;
}

.input-area {
    width: 100%;
    position: relative;
}

label {
    display: block;
    font-weight: 500;
    margin: 1.5em 0 0.5em 0;
    font-size: 1.1em;
    color: #000000;
}

textarea {
    resize: none;
    border: 1px solid #7e8580;
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    background: #e4e4e4;
    color: #3d3d3d;
    font-size: 1em;
    margin: 5px 0; 
}

textarea:focus {
    outline: none;
    border-color: #0088cc;
    box-shadow: 0 0 10px #dfdfdf;
}

textarea::placeholder {
    color: #4d4d4d;
}

textarea.invalid {
    border: 2px solid #ff4444 !important;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

button:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

button {
    background-color: #007BFF;
    color: #FFFFFF;
    font-size: 1.2em;
    border: none;
    padding: 1em;
    border-radius: 25px;
    outline: none;
    margin: 0.5em 0;
    cursor: pointer;
    height: 35px;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background-color: #828683;
    box-shadow: 0.6px 2.5px #dfdfdf;
    transform: scale(1.05);
    border: 1px solid #adb4af;
}

button:active {
    background-color: #474a48;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.button-group button i {
    color: white;
    font-size: 1em;
}

/* Input meta bar */
.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    margin: 4px 6px 10px 6px;
}

#char-count {
    color: #555555;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Validation message */
#validation-message {
    color: #ff4444;
    font-size: 0.85em;
    height: auto;
    padding: 2px 0;
    visibility: hidden;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-weight: 500;
}

#validation-message.show {
    visibility: visible;
}

/* Visual Flasher Beacon */
.flasher-beacon {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 8px 0 14px 0;
    transition: background-color 0.1s ease, box-shadow 0.1s ease;
}

.flasher-beacon.active {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* Playing Audio Pulse Animation */
.circle-btn.playing {
    background-color: #ff9800 !important;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); box-shadow: 0 0 0px rgba(255,152,0,0.7); }
    to { transform: scale(1.15); box-shadow: 0 0 15px rgba(255,152,0,0.9); }
}

/* Cheat Sheet Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 14px;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.2em;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #64748b;
    cursor: pointer;
    padding: 0 6px;
    margin: 0;
    height: auto;
    line-height: 1;
}

.close-btn:hover {
    color: #ef4444;
    background: none;
    transform: scale(1.15);
    border: none;
    box-shadow: none;
}

.cheat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    overflow-y: auto;
    padding-right: 6px;
}

.cheat-item {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cheat-item span.char {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    color: #007BFF;
    font-size: 1em;
}

.cheat-item span.code {
    font-family: monospace, monospace;
    font-weight: bold;
    color: #222;
    letter-spacing: 1.5px;
    font-size: 0.9em;
}

/* History panel */
#history-panel {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#history-panel h3 {
    margin-bottom: 10px;
    text-align: center;
}

#history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 0.9em;
}

.history-item div:first-child {
    font-weight: bold;
    margin-bottom: 5px;
}

#clear-history {
    width: 100%;
    margin-top: 10px;
    background: #ff4444;
}

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    .button-group button {
        width: 40px !important;
        height: 40px !important;
        margin: 5px !important;
    }
    
    .container {
        padding: 20px 15px;
    }
}

@media (max-width: 400px) {
    .button-group {
        justify-content: space-around;
    }
    
    .button-group button {
        margin: 3px !important;
    }
}
    
#history-panel {
    max-height: 150px;
}

@media (max-width: 400px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 600px) {
    #validation-message {
        font-size: 0.7em;
        margin: 3px 0 5px 0;
    }
}

#reverse.active {
    background-color: #474a48;
}

#reverse:hover {
    background-color: #828683;
}

.circle-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 5px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Scrollbar for Cheat Sheet & History */
.cheat-grid::-webkit-scrollbar,
#history-panel::-webkit-scrollbar {
    width: 6px;
}

.cheat-grid::-webkit-scrollbar-track,
#history-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cheat-grid::-webkit-scrollbar-thumb,
#history-panel::-webkit-scrollbar-thumb {
    background: #007BFF;
    border-radius: 10px;
}

.cheat-grid::-webkit-scrollbar-thumb:hover,
#history-panel::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

@media (max-width: 420px) {
    .cheat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}



