/* agent.css - Updated with button layout, agent list, and token select styles */
.hidden {
    display: none !important;
}

.functions-grid, .agent-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .functions-grid, .agent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .functions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .agent-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.function-checkbox {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: #1C2526;
    border-radius: 0.5rem;
    border: 1px solid #4B5563;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.function-checkbox:hover {
    background-color: #151923;
}

.function-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    accent-color: #F3BA2F;
}

.agent-card {
    background: linear-gradient(180deg, #1C2526 0%, #151923 100%);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #4B5563;
}

.agent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-color: #F3BA2F;
}

.agent-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #F3BA2F;
    margin-bottom: 0.5rem;
}

.agent-card p {
    color: #A0AEC0;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.simulation-log {
    border: 1px solid #4B5563;
    line-height: 1.5;
}

.simulation-log p {
    margin-bottom: 0.5rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.simulation-log .action-post {
    background-color: #48BB78;
    color: #0D1117;
}

.simulation-log .action-reply {
    background-color: #4299E1;
    color: #F7FAFC;
}

.simulation-log .action-like {
    background-color: #F6AD55;
    color: #0D1117;
}

.simulation-log .action-retweet {
    background-color: #10B981;
    color: #F7FAFC;
}

.simulation-log .action-search {
    background-color: #8B5CF6;
    color: #F7FAFC;
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Primary Button Styles */
.btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0.5rem;
    border: none;
    background: linear-gradient(90deg, #F3BA2F 0%, #DAA520 100%);
    color: #0D1117;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    flex: 1; /* Equal width for buttons */
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(90deg, #DAA520 0%, #F3BA2F 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 186, 47, 0.3);
}

.btn-primary:disabled {
    background: linear-gradient(90deg, #6B7280 0%, #4B5563 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Remove Button Styles */
.btn-remove {
    background: linear-gradient(90deg, #F56565 0%, #E53E3E 100%);
}

.btn-remove:hover:not(:disabled) {
    background: linear-gradient(90deg, #E53E3E 0%, #F56565 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

/* Responsive Button Layout */
@media (max-width: 640px) {
    .button-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    .btn-primary {
        width: 100%; /* Full width on mobile */
    }
}

/* Modal and Popup Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(180deg, #1C2526 0%, #151923 100%);
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(243, 186, 47, 0.2);
}

.close-btn {
    background: none;
    border: none;
    color: #A0AEC0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    z-index: 1002;
}

.close-btn:hover {
    background-color: #F3BA2F;
    color: #0D1117;
}

.modal-body {
    padding: 1rem;
}

.premium-popup .modal-content {
    background: linear-gradient(135deg, #1C2526 0%, #151923 100%);
    border: 2px solid #F3BA2F;
    box-shadow: 0 8px 32px rgba(243, 186, 47, 0.3);
    border-radius: 1rem;
}

.premium-popup:not(.hidden) .modal-content {
    transform: scale(1);
}

.premium-popup .modal-header {
    background: rgba(243, 186, 47, 0.1);
    border-bottom: 1px solid #F3BA2F;
    padding: 1.5rem;
}

.premium-popup .modal-body {
    padding: 1.5rem;
    text-align: center;
}

.premium-popup .modal-body p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #A0AEC0;
}

.premium-popup .btn-primary {
    background: linear-gradient(90deg, #F3BA2F 0%, #DAA520 100%);
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 0.75rem;
}

.premium-popup .btn-primary:hover:not(:disabled) {
    background: linear-gradient(90deg, #DAA520 0%, #F3BA2F 100%);
}

.premium-popup.error .modal-content {
    border-color: #F56565;
}

.premium-popup.error .modal-header {
    background: rgba(245, 101, 101, 0.1);
    border-bottom: 1px solid #F56565;
}

.premium-popup.error .btn-primary {
    background: linear-gradient(90deg, #F56565 0%, #E53E3E 100%);
}

.premium-popup.error .btn-primary:hover:not(:disabled) {
    background: linear-gradient(90deg, #E53E3E 0%, #F56565 100%);
}

.premium-popup.confirm .modal-content {
    border-color: #F3BA2F;
}

.premium-popup.confirm .modal-header {
    background: rgba(243, 186, 47, 0.1);
    border-bottom: 1px solid #F3BA2F;
}

.premium-popup.confirm .confirm-btn {
    background: linear-gradient(90deg, #F56565 0%, #E53E3E 100%);
}

.premium-popup.confirm .confirm-btn:hover:not(:disabled) {
    background: linear-gradient(90deg, #E53E3E 0%, #F56565 100%);
}

/* Form Group Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #F7FAFC;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #4B5563;
    border-radius: 0.5rem;
    background-color: #0D1117;
    color: #F7FAFC;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #F3BA2F;
    box-shadow: 0 0 0 2px rgba(243, 186, 47, 0.2);
}

.form-group input:disabled, .form-group select:disabled {
    background-color: #2D3748;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Additional Styling for agentConfigSection */
#agentConfigSection {
    background: linear-gradient(180deg, #1C2526 0%, #151923 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
    .top-section {
        grid-template-columns: 1fr !important;
    }

    .functions-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .ml-2 {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}