:root {
    --primary: #007fc8;
    --secondary: #2787be;
    --text: #333;
    --light-bg: #f8f9fa;
    --code-bg: #fafafa;
    --border: #ddd;
    --body-bg: #fff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--body-bg);
}

header {
    background-color: var(--primary);
    color: white;
    padding: 30px;
    border-radius: 5px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.author-link {
    color: white;
    text-decoration: underline;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 600;
}

h2 {
    font-size: 2rem;
    margin: 40px 0 20px;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

h3 {
    font-size: 1.6rem;
    margin: 30px 0 15px;
    color: var(--secondary);
}

p {
    margin-bottom: 18px;
    line-height: 1.7;
    font-size: 1.1rem;
}

code {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--code-bg);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 1rem;
}

pre {
    background-color: var(--code-bg);
    padding: 5px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

pre code {
    background-color: transparent;
    padding: 0;
    font-size: 1rem;
    display: block;
    padding: 18px;
    color: var(--text);
    line-height: 1.6;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

table, th, td {
    border: 1px solid var(--border);
}

th, td {
    padding: 12px 15px;
    text-align: left;
}

th {
    background-color: var(--light-bg);
    font-weight: 600;
}

hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 40px 0;
}

/* Container layout with better spacing */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 30px;
}

.doc-content {
    flex: 1 1 800px;
}

.tool-container {
    flex: 1 1 450px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    background-color: var(--light-bg);
    border-radius: 5px;
    padding: 25px;
    border: 1px solid var(--border);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tool-header {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    height: 42px;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    height: 42px;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button:hover {
    background-color: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.secondary-button {
    background-color: #6c757d;
}

.secondary-button:hover {
    background-color: #5a6268;
}

.output-container {
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.output-header h3 {
    margin: 0;
    color: var(--primary);
}

.icon-button {
    height: 36px;
    min-width: 80px;
    background-color: #4976b6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.output-container p {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9rem;
}

.arguments-container {
    margin-bottom: 15px;
}

.argument-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.argument-type {
    flex: 0 0 120px;
    height: 42px;
}

.argument-value {
    flex: 1;
    height: 42px;
}

.argument-remove {
    flex: 0 0 42px;
    background-color: #dc3545;
    color: white;
    height: 42px;
    width: 42px;
    padding: 0;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.button-group button {
    flex: 1;
}

#generateBtn {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
}

/* Add a div container for the generate button to maintain consistent margins */
.generate-container {
    width: 100%;
}

/* Animation effects */
.argument-row {
    transition: all 0.2s ease;
}

.flash {
    animation: flash-animation 0.5s;
}

@keyframes flash-animation {
    0% { background-color: rgba(73, 118, 182, 0.1); }
    50% { background-color: rgba(73, 118, 182, 0.3); }
    100% { background-color: transparent; }
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 8px;
}

/* Improved mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .tool-container {
        position: static;
        max-height: none;
    }
    
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .button-group button {
        width: 100%;
    }
    
    #generateBtn {
        width: 100%;
    }
    
    .argument-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .argument-type {
        flex: 1 1 100%;
    }
    
    .argument-value {
        flex: 1 1 calc(100% - 52px);
    }
    
    .argument-remove {
        flex: 0 0 42px;
    }
}

/* Wide screen optimization */
@media (min-width: 1600px) {
    body {
        max-width: 1600px;
    }
    
    .container {
        gap: 60px;
    }
    
    .doc-content {
        flex: 1 1 900px;
    }
    
    .tool-container {
        flex: 0 0 500px;
    }
}

.output-container pre {
    margin-top: 10px;
    min-height: 100px;
}

/* Override code background when in tables */
table code {
    background-color: transparent;
    padding: 0;
    border: none;
}