:root {
    --primary-color: #0071E3; /* Apple blue */
    --secondary-color: #505050;
    --text-color: #1d1d1f;
    --light-gray: #f2f2f7;
    --border-color: #d1d1d6;
    --error-color: #ff453a;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
    margin: 0;
    padding: 40px 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 8px 16px var(--shadow);
}

h1 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
    font-size: 2.2rem;
}

.input-section, .message-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--secondary-color);
}

textarea, select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    resize: vertical;
    min-height: 120px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.2);
}

#messageTemplate {
    min-height: 100px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

button:hover {
    background-color: #005bb5;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.output-section {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

pre, code {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'SF Mono', 'Consolas', Monaco, 'Andale Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--border-color);
}

.script-container {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    background-color: #fff;
    margin-top: 15px;
}

.copy-btn {
    max-width: 200px;
    width: fit-content;
    background: #f2f2f7;
    border: 1px solid #d1d1d6;
    color: #333;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #e8e8ef;
    border-color: #c1c1c9;
}

.copy-btn:active {
    background: #d5d5df;
}

.copy-btn.copied {
    background: #e0f7e0;
    border-color: #a0d0a0;
    color: #2e7d32;
}

.instructions {
    margin: 25px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.instructions h3 {
    margin-top: 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.instructions ol {
    padding-left: 20px;
    margin-bottom: 0;
}

.instructions li {
    margin-bottom: 12px;
    line-height: 1.5;
    color: var(--text-color);
}

#ahkScript {
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 25px;
}

@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    textarea, select {
        font-size: 15px;
    }
}

.radio-group {
    margin-top: 12px;
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--secondary-color);
    user-select: none;
}

.radio-group input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background-color: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-group input[type="radio"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.radio-group input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}