/* Reset & font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1000px;
    width: 100%;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.dark {
    background-color: #1a1a2e;
    color: #eee;
}
body.dark .container {
    background-color: #16213e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
body.dark textarea {
    background-color: #0f3460;
    color: #eee;
    border-color: #533483;
}
body.dark button {
    background-color: #533483;
    color: #eee;
}
body.dark button:hover {
    background-color: #6c4a9e;
}
body.dark .random-text {
    color: #f0f2f5;
}
body.dark .display-area {
    background: #1a1a2e;
}
body.dark .left-panel {
    background: #0f3460;
}
body.dark .utc-display {
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0; /* sáng hơn dễ đọc */
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}
.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

button {
    padding: 8px 18px;
    border: none;
    border-radius: 30px;
    background-color: #4a90e2;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
button:hover {
    background-color: #357abd;
}
button:active {
    transform: scale(0.96);
}
#theme-toggle {
    background-color: #6c757d;
}
#theme-toggle:hover {
    background-color: #5a6268;
}

.display-area {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 16px;
    background: #f8f9fa;
    transition: background 0.3s;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: background 0.3s;
}
.random-text {
    font-size: 1.6rem;
    font-weight: 500;
    text-align: center;
    color: #2c3e50;
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.utc-display {
    font-size: 0.95rem;
    font-weight: 400;
    color: #555;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 12px;
    border-radius: 20px;
    align-self: flex-start;
    margin-top: 10px;
}

.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
}
.right-panel textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 12px;
    resize: vertical;
    background: #fff;
    color: #333;
    transition: border-color 0.3s, background 0.3s, color 0.3s;
    font-family: inherit;
}
.right-panel textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

footer {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
footer button {
    flex: 1 1 auto;
    min-width: 100px;
}

@media (max-width: 700px) {
    .display-area {
        flex-direction: column;
    }
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .controls {
        justify-content: center;
    }
    footer {
        flex-direction: column;
        align-items: stretch;
    }
}