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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 0.95em;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
}

.btn-danger:hover {
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.4);
}


.response-box.success {
    border-left-color: #4caf50;
    background: #f1f8f4;
    color: #1b5e20;
}

.response-box.error {
    border-left-color: #f44336;
    background: #fef5f5;
    color: #d32f2f;
}

.response-box.info {
    border-left-color: #2196f3;
    background: #f1f8ff;
    color: #0d47a1;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #999;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-badge.success {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-badge.error {
    background: #ffcdd2;
    color: #c62828;
}

/* Scrollbar Styling */
.response-box::-webkit-scrollbar {
    width: 8px;
}

.response-box::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

.response-box::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.response-box::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .card {
        padding: 20px;
    }

    .tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .form-group input,
    .form-group select {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .btn {
        padding: 10px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 0.95em;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .tabs {
        gap: 3px;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.response-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* 💡 THIS KEEPS TABLE SAME SIZE */
    font-size: 14px;
}

.response-table th,
.response-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    /* no wrapping — keeps it compact */
}

/* Hover effect */
.response-table tr:hover td {
    background: #f7f7ff;
}

/* Highlight clickable cells */
.expandable-cell {
    cursor: pointer;
    color: #3f51b5;
}

/* Popup viewer */
.value-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    max-width: 90%;
    max-height: 70%;
    overflow: auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    white-space: pre-wrap;
}

.value-popup-close {
    text-align: right;
    margin-bottom: 10px;
}

.value-popup-close button {
    background: #ff4d4d;
    border: none;
    padding: 6px 12px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.response-box {
    background: #f5f5f5;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    max-width: 520px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    flex: 1;
    overflow: auto;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.response-table {
    width: max-content;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.response-table th,
.response-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.response-table th {
    background: #efefef;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.response-table td {
    color: #333;
}

.response-table tr:hover td {
    background: #f9f9f9;
}

.json-output {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid #ddd;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    display: block;
    margin: 0;
}