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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 32px;
    font-weight: 700;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    font-weight: 500;
}

.validation-message {
    background-color: #fef3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.2s;
    background-color: #fafafa;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input[type="text"].invalid,
select.invalid {
    border-color: #e74c3c;
}

input[type="text"].invalid:focus,
select.invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.checkbox-group {
    padding: 12px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-group label span {
    user-select: none;
}

.help-text {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.help-text a {
    color: #667eea;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

details {
    margin-top: 12px;
    padding: 12px;
    background-color: #f5f7fa;
    border-radius: 6px;
    cursor: pointer;
}

details summary {
    font-weight: 600;
    color: #2c3e50;
    user-select: none;
}

details ul {
    margin-left: 20px;
    margin-top: 10px;
}

details li {
    margin-bottom: 8px;
}

button {
    width: 100%;
    padding: 16px 24px;
    background: green;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

button[type="submit"] {
    width: 100%;
    background-color: #3498db;
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0px);
}

button[type="submit"]:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

#result {
    margin-top: 30px;
    border-radius: 8px;
    display: none;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#result.success {
    border: 2px solid #27ae60;
}

#result.error {
    border: 2px solid #e74c3c;
}

.result-header {
    background-color: #27ae60;
    color: white;
    padding: 16px 20px;
}

.result-header.error {
    background-color: #e74c3c;
}

.result-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.result-content {
    background-color: #f8f9fa;
    padding: 20px;
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-link {
    display: block;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    border: 2px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tool-link:hover {
    background: #764ba2;
    color: white;
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-3px);
}

.generate-keys-btn {
    display: inline-block;
    margin: 15px 0 20px 0;
    padding: 12px 24px;
    background-color: #9b59b6;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.3s;
}

.generate-keys-btn:hover {
    background-color: #8e44ad;
}

.explanation-box {
    background-color: white;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.explanation-box p {
    margin: 8px 0;
}

.explanation-box a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.explanation-box a:hover {
    text-decoration: underline;
}

.explanation-box ol li {
    margin-left: 1.5em;
}

.result-field {
    margin-bottom: 20px;
}

.result-field:last-of-type {
    margin-bottom: 0;
}

.result-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-value code {
    flex: 1;
    background-color: white;
    border: 1px solid #ddd;
    padding: 12px 15px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 15px;
    color: #2c3e50;
}

.key-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #2c3e50;
    background-color: white;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.key-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.copy-btn {
    width: auto !important;  /* Override the width: 100% from button */
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.copy-btn:hover {
    background-color: #2980b9;
}

.copy-btn.copied {
    background-color: #27ae60;
}

.result-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-btn,
.generate-keys-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.download-btn {
    background-color: #16a34a;
    color: white;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.generate-keys-btn {
    background: #9b59b6;
    color: white;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.generate-keys-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(155, 89, 182, 0.4);
}

.form-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.form-option-block {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.2s ease;
}

.form-option-block:hover {
    border-color: #667eea;
    background-color: #f5f7ff;
}

.form-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.form-option input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.form-option label {
    cursor: pointer;
    font-weight: 500;
    margin: 0;
}

.form-option-input {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.form-option-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-option-input select,
.form-option-input input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.form-option-input select:focus,
.form-option-input input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-option-input details {
    margin-top: 0.75rem;
}

.form-option-input summary {
    cursor: pointer;
    color: #667eea;
    font-weight: 500;
    user-select: none;
}

.form-option-input ul {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
}

.form-option-input li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
