/* ===========================
   Global Styles
=========================== */
* {
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    height: 100vh;
    display: flex;
}

/* ===========================
   Sidebar Styles
=========================== */
.sidebar {
    width: 300px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar h2 {
    margin: 5px 0 0;
    text-align: center;
}
.section {
    margin: 15px 0 0;
}
.template-list, .context-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}
.template-list li, .context-list li {
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    position: relative;
}
.template-list li.active, .template-list li:hover,
.context-list li.active, .context-list li:hover {
    background-color: #34495e;
}
.add-btn {
    width: 100%;
    padding: 10px;
    background-color: #1abc9c;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
}
.add-btn:hover {
    background-color: #16a085;
}
.delete-btn {
    background-color: #e74c3c;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 10px;
}
.delete-btn:hover {
    background-color: #c0392b;
}

/* ===========================
   Main Content Styles
=========================== */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
.main-content h1 {
    text-align: center;
}
label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}
textarea, input[type="text"], select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-size: 16px;
}
textarea:focus, input[type="text"]:focus, select:focus {
    border-color: #3498db;
    outline: none;
}
.variables, .context-section {
    margin-top: 20px;
}
.variable, .context-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.variable input.variableName,
.context-item input.contextName {
    flex: 1;
    margin-right: 10px;
}
.variable input.variableValue,
.context-item input.contextValue {
    flex: 2;
    margin-right: 10px;
}
.variable button.remove-variable-btn,
.context-item button.remove-context-btn {
    padding: 8px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.variable button.remove-variable-btn:hover,
.context-item button.remove-context-btn:hover {
    background-color: #c0392b;
}
#addVariableBtn, #addContextBtn {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#addVariableBtn:hover, #addContextBtn:hover {
    background-color: #2980b9;
}
#copyTemplateBtn, #copyBtn {
    padding: 10px 15px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    margin-right: 10px;
}
#copyTemplateBtn:hover, #copyBtn:hover {
    background-color: #7f8c8d;
}
#outputPrompt {
    width: 100%;
    height: 150px;
    padding: 10px;
    margin-top: 20px;
    resize: vertical;
    border: 2px solid #2ecc71;
    border-radius: 4px;
    background-color: #ecf9f1;
    font-size: 16px;
    transition: border-color 0.3s, background-color 0.3s;
    overflow: auto;
}
#outputPrompt.invalid {
    border-color: #e74c3c;
    background-color: #fdecea;
}
.button-group {
    display: flex;
    justify-content: flex-start;
}
.message {
    margin-top: 10px;
    font-size: 14px;
    color: #e74c3c;
    display: none;
}
.message.active {
    display: block;
}

/* ===========================
   Modal Styles
=========================== */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 400px; /* Could be more or less, depending on screen size */
    border-radius: 8px;
}
.close-modal {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
}
.modal input[type="text"], .modal textarea {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-size: 16px;
}
.modal button {
    padding: 10px 15px;
    background-color: #1abc9c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.modal button:hover {
    background-color: #16a085;
}

/* ===========================
   Tag Styles
=========================== */
.tag {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 5px;
    margin-top: 5px;
}

/* ===========================
   Textarea Padding Adjustment
=========================== */
textarea {
    padding-right: 20px; /* Additional right padding */
}
