/* DictaLearn - Professional CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    background-attachment: fixed;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    text-align: center;
    padding: 20px 0;
    background: #2c3e50;
    color: white;
    border-radius: 10px 10px 0 0;
    margin: -20px -20px 20px -20px;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
}

input, textarea, select, button {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

button {
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

button:hover {
    background: #5a67d8;
}

.btn {
    display: inline-block;
    background: #38b2ac;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin: 10px 5px;
    font-weight: bold;
}

.btn:hover {
    background: #319795;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.95em;
    color: #1565c0;
}

.text-box {
    background: #f1f8e9;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #689f38;
    font-size: 1.1em;
    line-height: 1.8;
}

.canvas-container {
    width: 100%;
    overflow: hidden;
    margin: 15px 0;
    border: 2px dashed #bbb;
    border-radius: 10px;
    background: #fffaf0;
}

canvas {
    display: block;
    margin: 0 auto;
    touch-action: none;
}

.tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

textarea {
    height: 100px;
    resize: vertical;
    font-size: 16px;
    line-height: 1.5;
    background: #f8f9fa;
}

.result-box {
    background: #e8f5e8;
    padding: 15px;
    margin: 15px 0;
    border-radius: 10px;
    border-left: 4px solid #4caf50;
}

#result {
    background: #fff3e0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #ffcc80;
}

#result p {
    line-height: 2;
    font-size: 1.1em;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.popup h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.popup select {
    margin-bottom: 15px;
    font-size: 16px;
}

.audio-section {
    text-align: center;
    margin: 20px 0;
}

audio {
    width: 100%;
    max-width: 500px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    header {
        margin: -15px -15px 15px -15px;
    }
    .tools {
        flex-direction: column;
    }
    .info-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Hindi Text Styling */
[lang="hi"] {
    font-family: 'Noto Sans Devanagari', 'Hindi', sans-serif;
}

/* Loading Animation */
#loader {
    display: none;
    text-align: center;
    color: #2980b9;
    font-weight: bold;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 8px;
    margin: 10px 0;
}

/* Success/Failure Animations */
.success {
    color: green;
    font-weight: bold;
}

.error {
    color: red;
    font-weight: bold;
}

/* Final Submit Button */
button[type="submit"] {
    background: #4CAF50;
    font-size: 1.1em;
    padding: 14px;
}

button[type="submit"]:hover {
    background: #45a049;
}

#textDisplay {
    display: block; /* Ensure visible */
}.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 2px solid #667eea;
}

.popup h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.popup select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.popup button {
    padding: 10px 15px;
    margin: 0 5px;
    font-size: 14px;
}
