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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    background: #1a3a5c;
    color: white;
    padding: 25px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

header h1 {
    font-size: 1.4em;
    margin-bottom: 5px;
}

header h2 {
    font-size: 1.1em;
    font-weight: 400;
    margin-bottom: 10px;
}

header h3 {
    font-size: 1em;
    color: #ffd700;
}

header .subtitle {
    font-size: 0.85em;
    color: #ccc;
    margin-top: 5px;
}

.api-section {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-section label {
    font-weight: 600;
    color: #856404;
}

.api-section select,
.api-section input,
.api-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ffc107;
    border-radius: 5px;
    font-size: 14px;
}

.form-section {
    background: white;
    padding: 25px;
    margin-bottom: 2px;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.form-section:last-of-type {
    border-bottom: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    margin-bottom: 20px;
}

.section-title {
    color: #1a3a5c;
    font-size: 1.15em;
    border-bottom: 2px solid #1a3a5c;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

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

.form-group > label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
    font-size: 0.92em;
}

.info-label {
    font-weight: 400;
    color: #888;
    font-size: 0.88em;
}

.info-text {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.1);
}

.input-with-btn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.input-with-btn textarea,
.input-with-btn input {
    flex: 1;
}

.generate-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
    min-width: 80px;
}

.generate-btn:hover {
    background: #218838;
}

.generate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.generate-btn.loading {
    background: #ffc107;
    color: #333;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 8px 0;
}

.radio-group label,
.checkbox-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.checkbox-group {
    flex-direction: column;
    gap: 8px;
}

.sub-options {
    margin-left: 25px;
}

.researcher-block {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.researcher-block h3 {
    color: #1a3a5c;
    font-size: 1em;
    margin-bottom: 10px;
}

.date-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.date-row label {
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9em;
}

.date-row input {
    width: auto;
    flex: 1;
    min-width: 150px;
}

.taahhut-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.88em;
    line-height: 1.7;
}

.taahhut-text ul {
    margin-left: 20px;
    margin-top: 10px;
}

.add-btn {
    padding: 10px 20px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #138496;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 25px 0;
    flex-wrap: wrap;
}

.export-btn {
    padding: 14px 35px;
    background: #1a3a5c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}

.export-btn:hover {
    background: #0d2137;
}

.generate-all-btn {
    padding: 14px 35px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}

.generate-all-btn:hover {
    background: #218838;
}

.api-btn-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.test-api-btn {
    padding: 8px 20px;
    background: #1a3a5c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.test-api-btn:hover {
    background: #0d2137;
}

#apiStatus {
    font-size: 13px;
    font-weight: 600;
}

#apiStatus.success {
    color: #28a745;
}

#apiStatus.error {
    color: #dc3545;
}

#apiStatus.loading {
    color: #ffc107;
}

.save-btn {
    padding: 14px 35px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}

.save-btn:hover {
    background: #138496;
}

.load-btn {
    padding: 14px 35px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}

.load-btn:hover {
    background: #5a6268;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a3a5c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.remove-btn {
    padding: 5px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    float: right;
}

.remove-btn:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .input-with-btn {
        flex-direction: column;
    }
    .date-row {
        flex-direction: column;
    }
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}
